Right, that's just draw call creation. My question is what's causing the draw calls to be changed? While dragging with culling turned off, the entire draw call does not change at all. It only changes at the time you start dragging. Do you have some element that's constantly changing, causing draw calls to be re-created?No, the panel is loaded and then it doens't change. Anyway, i included the deep profile of the same panel with NGUI 2.7.0 to make a comparison.
I just did a simple test:
1. New scene, ALT+SHIFT+S, ALT+SHIFT+C, right-click, add scroll view.
2. Drag & drop the sprite into the scroll view, right-click, attach drag scroll view.
3. Duplicated the sprite a few times, changed the names to make them unique.
4. Run, drag them around. I see the "Geometry changed: XXX" being called when items enter/exit the scroll view -- exactly what I expect as "culling" is on by default.
5. Changed "culling" to off, tried again -- nothing changes during the drag operation at all now.
I made the same test with the included scroll view panel example and the results are the same when culliing is on, but when culling is off I see 148 logs call in the console.
Can you please check this?
Using NGUI 3.8.2 and Unity 4.5.5.
Anyway, performance of draggable panels are still far away from NGUI 2.7.0.
I would advise you to have a look at endless scroll views example. You can create a scroll view with only a few entries that will be reused as they go out of range.
newlife, can you make a repro case, so I can try it? Just pm me a link, then I'll take a look.
Preferably with as close a setup to what you have problems with as you can.
Hey Michele & r.pedra,
Thanks for reading. I sorta felt the "use static" would be painfully obvious, but I mainly wanted to show the numbers associated to make it clearer just how much it helps.
I purposely didn't make a comparison with 2.7, because there have been so many underlying changes that it's not a fair comparison - performance in certain areas, like huge scroll lists, have been sacrificed in order to have explicit ordering the way it is now and other feature improvements.
There are ways to combat this, by not just putting all objects in but instead using containers which you fill with information when they're supposed to draw - then you're generally limited to <10 containers at any one time vastly increasing your performance (and making unlimited scroll lists possible).
NGUI does not do this internally at this point, and it's up to the individual developer to implement this. Without changing the scrollviews fundamentally, it's not something that's easily done on NGUI's end.