I spent much of Tuesday working on getting PyPy running SimpleParse. I have to be honest, I was kinda hoping I'd install PyPy and "pow" I'd have a 20x faster parser engine. It didn't quite work out that way, it was actually 2x slower, with no real explanation of why. My poor laptop hasn't been able to compile PyPy successfully yet, which seems to be necessary to get some of the tools to work, so I'm going at the problem from the other side.
Basically I'm planning to build up a grammar piece-by-piece and performance testing to see what causes the slow-down. Not enough time to get much done on that this evening, but the first few tests were pretty encouraging (compared to Tuesday, anyway). On a trivial grammar (a := 'a') parsing a large sequence of a's, PyPy was running approximately 45x faster than CPython. Even with a somewhat more complex grammar (a := [abc]) parsing the same long sequence of 'a's, the speed difference held up... I'm guessing that's mostly due to the object allocator (the test creates N 4-tuples of two ints, a list and an object), which, I'm told, is generally superior to the CPython one. Hopefully whatever is killing the performance in the real-world case will pop out as I create slightly more complex grammars.
Pingbacks are closed.