gll icon indicating copy to clipboard operation
gll copied to clipboard

Traversing larger forests quickly blows the stack

Open CAD97 opened this issue 6 years ago • 2 comments

eddyb 2019-04-18 at 11:56 AM EDT I need to optimize the iterators so they don't actually use BTreeSet iterators

eddyb 2019-04-18 at 11:57 AM EDT right now you have deep tree multiplied by a large constant factor (the size of the iterators)

eddyb 2019-04-18 at 12:00 PM EDT feel free to open an issue on the gll repo about stack usage of iteration of possibilities (which is what fmt::Debug does)

Right now, it's very easy to blow the stack when printing the debug representation of a gll forest of any nontrivial size.

CAD97 avatar Apr 19 '19 23:04 CAD97

Any recursive traversal will do this (as you end up with a lot of iterators on the stack).

eddyb avatar Apr 20 '19 14:04 eddyb

So, this could happen during forest evaluation too?

My parse forest uses explicit Vec stacks instead of recursion, here.

pczarn avatar May 25 '19 18:05 pczarn