At what point should you worry about ObjectPooling? (Mobile)

Hey guys,

I’m deciding if I should bother pooling my objects in a current project. The maximum amount of objects that would get instantiated at any given second is about 5. Same goes for Destroy. But all this happens about every 10 seconds.

The reason I say this is because a large number of the objects will be moving/scaling/rotating and I’d need to reset values every time I despawn for pooling. I’d like to keep the code as streamlined as possible, which means Destroy() is what I would default to.

Thanks :slight_smile:

EDIT: Also, How bad is Resources.Load? It’s so convenient.

how well does it run without pooling? are you getting lag? have you checked through the profiler, no idea if it has mobile centric tools but it’ll give you a good idea of what the game is actually doing.

“at what point should you worry about optimisation x?”
“when not doing x is causing a problem”

2 Likes

I’m with @LeftyRighty : don’t bother optimizing it unless it’s a pain point. Time spent optimizing this game is time NOT spent on something else in your life, and unless you just want to practice writing object poolers, why bother?

1 Like

Thanks a lot guys!