Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2002-10-13 19:42:51

----- Original Message -----
From: "Carl Daniel" <cpdaniel_at_[hidden]>

> More review to come, but in the meantime, a question: have the Spirit
> developers attempted to measure the performance of Spirit-generated parsers
> against other parser generators (e.g. YACC, Bison, ANTLR)? Similarly, any
> have comparisons of generatd code size been done?

There were informal benchmarks here and there, not only for code size and
runtime performance but for compile time as well. It should be the right time
to formally compile them and produce a report.

> I ask because I was just experimenting with the samples and taking a look at
> code sizes, etc. For example, the Pascal sample, when compiled with a
> compiler that's a lot like VC7 (but isn't VC7...) produces an executable
> with 176K of code. Based on the small test files that are included with the
> distribution, it appears to parse the Pascal syntax "quickly" :) IIRC, the
> entire Turbo Pascal compiler was about the same size, including the code
> generator, for a more complex language. Of course, it was written in
> assembly (by the father of C#), so I'd expect it to be small & fast, but the
> comparison did get me wondering...

I've also had reports that the use of subrules slashes the code size
significantly. Here's a quote from John Hohm. He was the first
who tested the significance of subrules; not with the Pascal grammar

The improvement is relatively and absolutely much better when
stripping with 'strip --strip-unneeded': from 1MB with spirit-1.3 to 268KB
with spirit-X subrules (and -O3, which is still smaller than -Os). Of
course, I would still like it to be smaller, but it's now much smaller than
a weaker ANTLR parser I experimented with, so I can't rightly complain. :-)

The current Pascal demo does not use subrules.

> I would think that the Pascal example might be a good one to benchmark -
> it's a non-trivial grammar, and I would expect that YACC and ANTLR grammars
> for Pascal are readily available "out there".

Indeed. I'll start a conscientious initiative towards this goal.
In addition, it would also be nice to also benchmark micro-parsers.
I'd apprecieate some help ;-) It would be interesting to get
the results from different compilers. I certainly would want to
see the results of subrules with the Kuck & Associates compiler.


Boost list run by bdawes at, gregod at, cpdaniel at, john at