News for hackers. Stuff that matters.
Re:The compiler will optimize that away by kaba0 on Tuesday May 04, 2021 @04:03PM (#27042216)
I’m not disagreeing with you, and as a very general advice, less allocation is better of course.

My point was more along the way that sometimes very non-intuitive (from a low-level perspective) solutions may optimize better, because that’s what the compiler writers optimized for.

And object pools at least in Java is not necessarily good. The first go at it should be the plainest implementation one can imagine (on a micro level. Of course architecturally it is important to think about optimization, like whether it will be a class or an array, etc.)

There are no comments on this comment yet.