[erlang-questions] speed of neotoma parser

Max Lapshin max.lapshin@REDACTED
Mon May 30 13:54:09 CEST 2016


This story ended with writing handmade parser.

Seems that we've accidentially created some O(N^2) code in
neotoma-generated parser, because small files are parsed quickly, but big
files (50KB, 100KB and more) are parsed very slowly with our grammar.

New handmade parser can parse in a linear time, something like 50 ms for a
200KB file when our neotoma grammar takes about 50 seconds or more.

Sean have looked at our PEG grammar and confirmed that we have made
anti-optimal grammar that creates bad parser (right, Sean?).


I've looked at alternatives (it is hard to find anything as convenient as
neotoma, I think that it is most convenient) and had to refuse from leex +
yacc, because we have already made syntax that has dependency in lexical
parsing from semantic context (I suppose that it has).


So I've written in 2 days plain erlang code that just works on all our
tests and all examples of user configs.


Thanks again for all hints and help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160530/5935bbed/attachment.htm>


More information about the erlang-questions mailing list