This is an example of a small real world-ish program.
The only setup required after cloning is to run
There are 3 iterations of a server that responds with a JSON payload containing an millisecond timestamp date, and an ID.
- Responds with a payload generated by a sub-optimal function
- Responds with a payload generated by an optimal function
- Responds with a payload generated by with a smaller call-graph
- Responds with a payload generated without a serializer (without
Each should produce different Flame results indicating the stack profiles of each.
1 you should see a very few request per second.
2 you should see much higher requests per second, about 50x faster than
3 you should see around double the amount of requests per second versus
4 you should see roughly a 10% improvement versus
To get started, generate a flame graph for the first server:
clinic flame --on-port 'autocannon localhost:$PORT' -- node 1-server-with-slow-function.js