[Python-Dev] CML2 compiler slowness

Eric S. Raymond esr@snark.thyrsus.com
Mon, 12 Mar 2001 18:36:00 -0500


(Copied to python-dev for informational purposes.)

I added some profiling apparatus to the CML2 compiler and investigated
mec's reports of a twenty-second startup.  I've just released the
version with profiling as 0.9.3, with fixes for all known bugs.

Nope, it's not the quadratic-time validation pass that's eating all
the cycles.  It's the expression parser I generated with John
Aycock's SPARK toolkit -- that's taking up an average of 26 seconds
out of an average 28-second runtime.

While I was at PC9 last week somebody mumbled something about Aycock's
code being cubic in time.  I should have heard ominous Jaws-style
theme music at that point, because that damn Earley-algorithm parser
has just swum up from the deeps and bitten me on the ass.

Looks like I'm going to have to hand-code an expression parser for
this puppy to speed it up at all.  *groan*  Anybody over on the Python
side know of a faster alternative LL or LR(1) parser generator or
factory class?
-- 
		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

It will be of little avail to the people, that the laws are made by
men of their own choice, if the laws be so voluminous that they cannot
be read, or so incoherent that they cannot be understood; if they be
repealed or revised before they are promulgated, or undergo such
incessant changes that no man, who knows what the law is to-day, can
guess what it will be to-morrow. Law is defined to be a rule of
action; but how can that be a rule, which is little known, and less
fixed?
	-- James Madison, Federalist Papers 62