[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance of SableCC v ANTLR

On Wednesday 07 May 2003 12:36, Steve Jones wrote:
> It was only when I started to compile larger programs (>250 lines) that I
> noticed that the compilation was taking several seconds on a 2.1 Ghz PC.
> This worried me greatly.
> My observations so far are that the ANTLR front-end runs more than five
> times faster than the SableCC equivalent. SableCC produces 445 AST node
> types for the grammar, the ANTRL solution just 77.

I observed something similar once and then discovered it was my own fault
for I was not using buffered input. Eg. make sure your input stream is
buffered, eg. wrap it into BufferedInputStream.

Still it would probably help a lot more to benchmark this slowness more
precisely and to measure what part of the parser generation process is
causing you trouble.

As far as I remember it was remarkably fast for me, only 2-3 times slower
than similar bison parser. But, well, this is anecdotal evidence, and around
a year or two ago.

But as I'm not really familiar with sablecc internals so I can't help you
here any more.