4 ms·
I don't necessarily buy being blocked by CPU-intensive operations as a rationale as to why you shouldn't Node, given that it's pretty trivial to offload these o
by RSZC 10y ago
I don't necessarily buy being blocked by CPU-intensive operations as a rationale as to why you shouldn't Node, given that it's pretty trivial to offload these onto a separate process.
https://github.com/LearnBoost/cluster https://github.com/LearnBoost/cluster - one I've used
- nrjdhsbsid 10y agoIt is non trivial to share state between node threads. The state is shuffled around outside of the VM unlike go, Java, and c#. In those languages, the overhead of sharing a variable are basically zero. In node you get sharing at basically the speed of TCP local sockets on the machine. So maybe 5GBps. With natively threaded languages you get sharing at the speed of the cpu cache, orders of magnitude faster If performance is important enough that multithreading comes into play, don't use node.
- ilaksh 10y agoSee `webworker-threads`.
- nrjdhsbsid 10y agoThey don't share variables low level, so the problem remains. In Java and similar languages the variables are shared at the machine level, including atomics
- nrjdhsbsid 10y agoThey don't share variables low level, so the problem remains. In Java and similar languages the variables are shared at the machine level, including atomics