2 ms·
Can't explain exactly why, but the overhead of one OS thread is much greater than the overhead of one routine in the event loop, and it's worth researching if y
by hot_gril 3y ago
Can't explain exactly why, but the overhead of one OS thread is much greater than the overhead of one routine in the event loop, and it's worth researching if you're interested. It's also worth looking into how kernel IO resources would deal with 3000 threads making calls all at once; like, the network stack has a queue. A while ago I ran a test of how many min-size UDP packets I could send per second with a multithreaded process.
Also can say at least that paging to/from disk or using memory compression would dominate all other overheads, and it's not something to rely on here.