[Pyparsing] Painfully slow parsing.
Brought to you by:
ptmcg
From: John K. <jkr...@lt...> - 2009-08-28 23:43:57
|
Hello, I have a serious speed problem with a parser written using pyparsing, where it's taking ~13 minutes to parse a 30 line file. I'm totally lost on what might be causing it, as small variations seem to be causing large differences in parsing time. I was hoping I could get some tips on general optimization strategies to follow. For instance, I'm suspicious that I should be trying harder to use the '-' operator, and wonder if that would help... I've posted my project on google code for easy access, the relevant bit that defines the parsing grammar if I can interest someone in taking a look, is at: http://code.google.com/p/compactxml/source/browse/compactxml/expand.py I'm making heavy use of significant whitespace and pyparsing.indentedBlock, so it does feel like I'm fighting against pyparsing a bit. Unfortunately, it looks like indentedBlock is incompatible with packrat parsing, so the most obvious performance improving tip looks to be unusable. I'm also unsure if the mailing list is the best place to ask for help, as it looks like there's more traffic on the pyparsing home page discussion tab? -- John Krukoff <jkr...@lt...> Land Title Guarantee Company |