3 ms·
I would think the old async stuff is slower because it intrinsically requires much more memory allocation as you need to create objects and store state for ever
by brabel 3y ago
I would think the old async stuff is slower because it intrinsically requires much more memory allocation as you need to create objects and store state for everything. If you used Virtual Threads under the hood, those problems would not just disappear.
- cogman10 3y agoIt's usually a wash, maybe even a little against virtual threads as they have to store stack information along side all the state for the current context. One of the major changes to the JVM to make virtual threads work revolved around setting up the stack to be as light weight as possible.