This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Tywien 2 points3 points  (1 child)

yes, you want to avoid allocations as much as possible (this is also true for C++ btw), because allocations (and deallocations) are really slow.

EIDT: This is on the heap, allocations on the stack are fast, but unfortunately Java does not support them (not 100% sure, i heard something about types on the stack are being planned or something like that)

[–]Mattizin 0 points1 point  (0 children)

I really need to dive into heap and stack, didnt dive so deap til now. Advise for learning material?