Hacker News new | ask | show | jobs
by nickfargo 4473 days ago
Referencing C10k implies yes. Threads cost.
1 comments

Do you know what threads cost? Probably not.

Linux has an O(1) scheduler.

Threads do have a cost in terms of virtual memory, but on 64-bit architectures, this is a non-issue.

Optimizing for "C10K" (which, btw, was a big number in 1999, not today) by using an event loop will actually harm latency and performance in the case that you are dealing with a small number of highly active connections. Believe it or not the kernel can do just as good (or better) a job of scheduling than Node's event loop.