Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clinicjs/node-clinic-flame-demo
A Clinic Flame example
https://github.com/clinicjs/node-clinic-flame-demo
Last synced: about 2 months ago
JSON representation
A Clinic Flame example
- Host: GitHub
- URL: https://github.com/clinicjs/node-clinic-flame-demo
- Owner: clinicjs
- License: mit
- Created: 2018-07-17T15:43:36.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2020-08-21T19:54:28.000Z (over 4 years ago)
- Last Synced: 2024-11-04T15:51:36.215Z (2 months ago)
- Language: JavaScript
- Homepage: https://clinicjs.org/
- Size: 7.81 KB
- Stars: 34
- Watchers: 22
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flame Example
This is an example of a small real world-ish program.
The only setup required after cloning is to run `npm install`.
There are 3 iterations of a server that responds with a JSON payload containing
an millisecond timestamp date, and an ID.1. Responds with a payload generated by a sub-optimal function
1. Responds with a payload generated by an optimal function
1. Responds with a payload generated by with a smaller call-graph
1. Responds with a payload generated without a serializer (without `JSON.stringify`)Each should produce different Flame results indicating the stack profiles of each.
Upon profiling `1` you should see a very few request per second.
Running `2` you should see much higher requests per second, about 50x faster than `1`.
Running `3` you should see around double the amount of requests per second versus `2`.
Running `4` you should see roughly a 10% improvement versus `3`.
To get started, generate a flame graph for the first server:
```sh
clinic flame --autocannon [ / ] -- node 1-server-with-slow-function.js
```