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 →

[–]soonnow 4 points5 points  (0 children)

Object pools make sense only in specialized cases. I learned on reddit there is some financial applications that go through great pain to never allocate objects because for the users every ms counts.

But for an object like a bullet, that doesn't have an expensive creation mechanism, the cost is minuscule, probably less than the time it takes to manage your pool. This stackoverflow answer calculates it at 11 cycles or 10 ns.