-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Traversers can be very problematic for performance when dealing with large schemas and queries. Personally, we've moved a lot of code to manual iteration due to these concerns. We reserve usage of those traversers only when complex state is needed.
The main cost seems to be the allocations of StackTraverserState.pushAll
, but also the getChildren
call (for NodeTraverser especially, where getNamedChildren allocates a children container on every call). Overall the state tracking of most traversers can be surprisingly expensive.
Questions for you folks: Has there been discussions of this on your side before? How much could we improve the current traversers? Could we consider offering lower overhead traversals for when less state is needed for example?
Thanks!