node-libcurl icon indicating copy to clipboard operation
node-libcurl copied to clipboard

Benchmarking context switching

Open danielecr opened this issue 5 years ago • 2 comments

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?

danielecr avatar May 04 '20 08:05 danielecr

Sure, I thought about that but didn't have time to create something related. Feel free to do so.

Some options:

  1. Some loop doing something that blocks the UI
  2. Call some crypto library and have it do some hashing
  3. Something else?

JCMais avatar May 04 '20 10:05 JCMais

I like option 2. that is more versatile and less invasive. I save a time-slot for tomorrow, I hope to commit something

danielecr avatar May 04 '20 11:05 danielecr