softdevteam / lrpar

Rust LR parser
Other
1 stars 0 forks source link

Use a deque for the todo list. #31

Closed ltratt closed 7 years ago

ltratt commented 7 years ago

Since the todo list can sometimes become very large "remove" becomes comically inefficient due to the need to shuffle all items to the left: in the worst case I've observed it taking 99% of program execution time. Using a deque largely solves this problem. On a really nasty example this reduces execution time on my machine from over 9 minutes to 9 seconds.

snim2 commented 7 years ago

I can't see anything to object to here, presumably I can merge as-is?

ltratt commented 7 years ago

Yep, I think so.