samim Posted March 31, 2014 Share Posted March 31, 2014 I´ve got a scenario where i´m creating & destroying hundreds of sprites over and over. Performance is rock solid but nevertheless curios about this.Would a object recycling/pooling system increase performance substantially? e.g. instead of spawning & destroying the sprites, re-using them. Quote Link to comment Share on other sites More sharing options...
Mat Groves Posted March 31, 2014 Share Posted March 31, 2014 Hello! Yes! Pooling is almost always worth it in my opinion Quote Link to comment Share on other sites More sharing options...
xerver Posted March 31, 2014 Share Posted March 31, 2014 > creating & destroying hundreds of sprites over and over. Then if you looked at your GC it would be going nuts, and most likely on mobile perf would be awful. Pooling is almost always worth the overhead (especially in the scenario you describe). Quote Link to comment Share on other sites More sharing options...
samim Posted April 2, 2014 Author Share Posted April 2, 2014 great, thanks for the heads up. Implementing a pooling system now. Does anybody know what the cost of a SetTexture is VS destroy/create ? Quote Link to comment Share on other sites More sharing options...
xerver Posted April 2, 2014 Share Posted April 2, 2014 great, thanks for the heads up. Implementing a pooling system now. Does anybody know what the cost of a SetTexture is VS destroy/create ? setTexture is cheaper; how much cheaper depends on your renderer and the texture. Quote Link to comment Share on other sites More sharing options...
samim Posted April 3, 2014 Author Share Posted April 3, 2014 setTexture is cheaper; how much cheaper depends on your renderer and the texture. "depends on the texture"? what are some performance guidelines here?e.g. use square textures only / use powerOf2 sizes only / don´t scale in code ? Quote Link to comment Share on other sites More sharing options...
xerver Posted April 3, 2014 Share Posted April 3, 2014 "depends on the texture"? what are some performance guidelines here?e.g. use square textures only / use powerOf2 sizes only / don´t scale in code ? If you are using separate texture images each time you update it there is a performance cost of re-uploading to the GPU. If the same iamges is used that cost doesn't exist. Quote Link to comment Share on other sites More sharing options...
samim Posted April 3, 2014 Author Share Posted April 3, 2014 If you are using separate texture images each time you update it there is a performance cost of re-uploading to the GPU. If the same iamges is used that cost doesn't exist.Ok great insight, hails back to what i learned from the UDK/Unity world - tnx.Wish there was a clear performance breakdown for stuff like tint / setTexture / scale.Even though its pure vanity at this point as we´re rocking 50>60fps on most major platforms now. Pixi rules! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.