Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: DuaneDog on March 05, 2014, 06:40:55 AM

Title: Would pooling be a best practice for handling labels in scrollviews?
Post by: DuaneDog on March 05, 2014, 06:40:55 AM
When I'm populating my scrollviews, right now I'm destroying all of them and then loading then reinitializing them to repopulate the scrollview. Once the list gets more than about 50 items you can actually see the performance hit. I'm curious if a better practice would be to use some kind of pooling so that at least after the first time they are made rather than creating and destroying them over and over they are reused?
Title: Re: Would pooling be a best practice for handling labels in scrollviews?
Post by: ArenMook on March 05, 2014, 07:36:44 AM
Sure, if you disable them instead of destroying them, you can unparent them and keep them in some kind of a cache.
Title: Re: Would pooling be a best practice for handling labels in scrollviews?
Post by: Nicki on March 05, 2014, 01:59:07 PM
Caching and pooling is generally always a better option, since intantiate is hardly free. It's just a bit of work, so if it's not needed, people tend to not do it.