Performance Issue - garbageCollectStates

I wrote a quadtree for rendering a terrain … it’s working fine so far, but it’s really slow. Pstats tells me, App::ShowCode::garbageCollectStates would consume almost 7 ms … when I increment the number of rendered objects (but not increment the vertice count), garbageCollectStates gets even slower …

I think it might be, because I have many hidden objects, or there is something wrong with my code? (I attached it)
The __update task (which regenerates the quadtree) is still slow, but ignore it :slight_smile:


Screenshot: (6.26 KB)

What happens if you disable the RenderState and TransformState cache by setting “state-cache” and “transform-cache” to 0 in Config.prc?

Thanks, that was the solution!