Skip to content

Conversation

@walruscow
Copy link

Deeply nested documents can cause a stack overflow due to recursion. Avoid that by using a heap based stack instead.

This includes a first commit to infer the sibling index from the parent, so that the iterative approach is simpler

  • Tested with a 1mb document with 100k nested nodes, now no longer crashes
  • cargo test

This would resolve issues #66 and (arguably) #68

Since there is no maximum depth option added here, it is possible to go fully OOM, but much larger documents are supported than previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant