Re: [Pyparsing] Painfully slow parsing.
Brought to you by:
ptmcg
From: Eike W. <eik...@gm...> - 2009-09-03 15:09:05
|
On Monday 31 August 2009, John Krukoff wrote: > I do say was, though, as I stumbled across this comment on the > discussion board: > > http://pyparsing.wikispaces.com/message/view/home/13557997 > > Which was an instance of someone else having a performance problem > with pyparsing.indentedBlock. His solution worked for me, and > didn't break any of my test suite. My parser still isn't speedy, > but at least it's not ridiculous anymore (from 13 minutes to parse > that test case down to about a tenth of a second). I patched > indentedBlock as so: That's an interesting find. I put the modification into my patched version of Pyparsing and it didn't break any tests in my project too. The modification also solves one problem where Pyparsing can't parse a complex but syntactically correct file. Without the modification the parser crashes with "RuntimeError: maximum recursion depth exceeded". So this modification seems to be quite usefull. John, you should put a patch into Pyparsing's tracker, so that it doesn't get lost. http://sourceforge.net/tracker/?atid=617313&group_id=97203&func=browse Kind regards, Eike. |