3 ms·
> It’s always off-putting to me that claims written this way can be taken seriously as a technical criticism, but our industry is rather unserious. It's not th
by cryptonector 3y ago
> It’s always off-putting to me that claims written this way can be taken seriously as a technical criticism, but our industry is rather unserious.
It's not the industry. It's people.
> What these people advocate instead is an alternative architecture that they call “thread-per-core.” They promise that this architecture will be simultaneously more performant and easier to implement. In my view, the truth is that it may be one or the other, but not both.
Thread-per-core is hands-down better for performance. That's because you can't rely on storing application state smeared on a thread/co-routine stack, so you have to instead make all your state explicit, and in the process you'll effectively compress it by no longer smearing it on a very large data structure called the call stack. Smaller state == less cache thrashing.
The problem with thread-per-core is that you really need async/await or coding in continuation passing style in order to make it work. CPS is mostly not an option in most cases, so async/await it has to be.
Developers should understand the concepts of thread-per-core and thread-per-client and pick the best one for their case. IMO thread-per-core is always better because if your application explodes in popularity then you'll really care to make it more efficient, but rewrites are always hard or infeasible, so if you get it right from the beginning, then you win. What I mean by "pick the best one" then has to do with the developer's skills and productivity and time constraints. Sometimes "best" is about what you can manage, not what's "best" in an objective vacuum that ignores real-world constraints.
- IshKebab 3y ago> It's not the industry. It's people. Yes, and this is just naive to think that other industries are somehow bastions of serious debate.