3 ms·
Agreed, low latency Java is very far from standard Java programming. > or have to do heap allocation FYI, heap allocation in Java is much cheaper (~11 cycles)
by bitcharmer 6y ago
Agreed, low latency Java is very far from standard Java programming.
> or have to do heap allocation
FYI, heap allocation in Java is much cheaper (~11 cycles) than in C++ as it's just a bump-the-pointer in TLAB.
https://stackoverflow.com/a/38298326/1278647 https://stackoverflow.com/a/38298326/1278647
- dcolkitt 6y agoWell, my point is that in C++ objects can be allocated on the stack.
- bitcharmer 6y agoJava can allocate on the stack too or perform partial allocation of exploded objects thanks to escape analysis.
- dcolkitt 6y agoThanks, didn't know that. Will have to look into it.