Skip to content

Traversers performance concerns #4025

@xuorig

Description

@xuorig

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions