Benchmarking context switching
This morning I had a discussion about benchmark result. Some way it come out there is not real use-case for 1000 continuous requests, most of the time an application is doing "somethingelse" between a request (or group of requests), and another.
Of course the tests should be reproducible, and the benchmark well defined, so this "something-else" must be of constant cost, or in a predefined distribution of costs between each request, but not a simple setTimeout(), because it requires no real switch. Actually setTimeout() may causes an OS context switch for multitasking management, that is not exactly desirable for a reproducible test.
Candidates would be a different subsystem of nodejs, or another library to load.
Does it makes sense to add a benchmark like this?
Sure, I thought about that but didn't have time to create something related. Feel free to do so.
Some options:
- Some loop doing something that blocks the UI
- Call some crypto library and have it do some hashing
- Something else?
I like option 2. that is more versatile and less invasive. I save a time-slot for tomorrow, I hope to commit something