Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

fnparse recursive? #8

Closed
aboytsov opened this issue Feb 4, 2013 · 0 comments
Closed

fnparse recursive? #8

aboytsov opened this issue Feb 4, 2013 · 0 comments

Comments

@aboytsov
Copy link

aboytsov commented Feb 4, 2013

Hey, guys,

We're using fnparse in Drake, and we're running into some parsing performance and stack issues. Parsing a 15k line source of a very simple structure takes forever (minutes) and fails with stack overflow. I tried to profile it with YourKit Java Profiler, and I'm getting endless stack traces full of monads' m_bind_state_t and m_bind_maybe:

Screen Shot 2013-02-04 at 12 37 12 AM

The list of most expensive methods by self-time.

Screen Shot 2013-02-04 at 12 37 24 AM

It might be that we're doing something wrong defining grammar. Just in case you want to look at it, it's defined here and here.

We used the JSON parser example as a base, and we use a similar method for updating the current column/line numbers. One observation is that getting rid of column/line tracking reduces parsing time of ~500 line file from 4s to <2s or so. Just that simple change.

We're looking for any advice on how to bring parsing times under control, and also if there's a more efficient method for updating column/line than used in your example.

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants