SpriterHaxeEngine icon indicating copy to clipboard operation
SpriterHaxeEngine copied to clipboard

pooling

Open loudoweb opened this issue 10 years ago • 3 comments

Pooling will be a great improvement. I began to implement it (https://github.com/loudoweb/SpriterHaxeEngine/commit/5443ab41c53ac781d94f1b2eb62321a779119369)

When all objects that are instanciated many times per frames will be ready for pooling, it will be great to use typedef or something else to fallback to a specific pooling system from a framework (flixel, flambe, etc.)

loudoweb avatar Aug 12 '15 15:08 loudoweb

That's quite a big pool (just think of all the body parts and multiply that by the number of objects) so you might want to keep an eye on the GC (https://groups.google.com/forum/m/?hl=en#!topic/haxelang/794gdCNNQdA).

sruloart avatar Aug 12 '15 16:08 sruloart

Didn't think about it :/

What do you suggest?

Maybe first trying to not allocate a lot (copy() and clone() features are too much used and it results in allocating too much SpatialInfo.) Add destroy() method in every class that need it. And only then investigate for pooling?

loudoweb avatar Aug 12 '15 17:08 loudoweb

I don't really know, testing may be in order :)

sruloart avatar Aug 12 '15 21:08 sruloart