3 ms·
Threads in Python in python are locked to a single core, and in NodeJS it's really annoying to pull off. That's why people use PM2, Uvicorn and Gunicorn.
by TheRoque 2y ago
Threads in Python in python are locked to a single core, and in NodeJS it's really annoying to pull off. That's why people use PM2, Uvicorn and Gunicorn.
- Filligree 2y agoThat would be a problem, then. I'm always surprised when people try to write high-performance code in Python or JS.
- TheRoque 2y agoNobody talked about "high performance". I'm just talking about using all the cores on a machine. People write stuff in Python and JS for obvious reasons that I don't need to detail here.
- Filligree 2y agoPerformance is best judged on a logarithmic scale. Most software barely needs any, and there are many orders of magnitude between "barely uses the CPU" and "uses 100% of a core". But once you're at 100% of a core, then there aren't many orders of magnitude between that and "uses every core". In fact, the impact from not using a scripting language is on the same order as the threading would be! So, if it's worth spending effort squeezing out those last 1-2 orders of magnitude from the CPU, then it's probably worth thinking about the language as well. If you've already blown through 4-5 OOMs going to a full core, then chances are you'll need it.
- carom 2y agoThis is why I don't write serious applications in Python and Node.