[antlr-interest] Re: ANTLR vs FLEX/BISON: performance issues?

gary_schaps gschaps at attbi.com
Thu Sep 5 14:22:25 PDT 2002


Hi Terence-

I haven't done any performance profiling on interpreted code.
What I've seen most recently is that an ANTLR generated C++
compiler I'm writing spends most of it's time in ANTLR code, 
and that aggressive compiler optimization (MSVC6.0 "\Ox") of
both the ANTLR C++ libraries and my code improves execution
time by a factor of seven, versus no compiler optimization.

The optimzed C++ compiler exection times are about the same as
what I see from a very similar ANTLR generated JAVA compiler,
compiled into a native Windows executable using JOVE 
(www.instantiations.com).  

>>From my perspective, these times are very satisfactory as I'm able
to process a 130MB input set in ~3.5 minutes.

I think it would be very interesting to see what the performance
improvement would be if I added a FLEX generated lexer.  If I
can get money for a summer hire or coop student next year, maybe
I will make it their project.  Right now, things are kinda tight,
and no one's complaining about compile times.

Thanks!

Gary 

--- In antlr-interest at y..., Terence Parr <parrt at j...> wrote:
> 
> On Thursday, September 5, 2002, at 06:48  AM, gary_schaps wrote:
> 
> > Elias-
> >
> > I have observed a 7X performance improvement in ANTLR
> > generated compiler front ends through the use of aggressive
> > compiler optimization.  And my input sets are quite large
> 
> Hi Gary, good to hea from you again :)
> 
> Meaning ANTLR interpreted vs compiled is 7x or compiled ANTLR vs
C++ 
is 
> 7x?
> 
> > (>130 MB) so I have confidence that this is real.  I've
> > achieved these results using the JOVE native compiler for
> > JAVA and the "-Ox" compiler flag in MSVC++ 6.0 for C++ with
> > two different compilers showing very similar results.
> 
> We should make a quicky little write up on this and make a faq or 
small 
> article on the site.
> 
> I hope to have time to redo the site this Fall.
> 
> Ter
> 
> >
> > Gary Schaps
> >
> > --- In antlr-interest at y..., Elias Biris <user_sofia at b...> wrote:
> >> Hi,
> >>
> >> thanks for this. It is the first reply I got :-)
> >>
> >> I was thinking mainly whether the difference in performance in 
the
> >> generated parser has any similarity to the difference in
> > performance
> > of
> >> the lexer side (as far as I know from reading the FAQ at jguru
> > there
> > is
> >> an issue of performance of the lexer when compared to flex 
generated
> >> lexers).
> >>
> >> Also I am interested in the issue of grammar inheritance: is that
> >> feasible in pccts at all? Has anyone tried this with ANTLR?
> >>
> >> Best regards,
> >>
> >> Elias
> >>
> >> On Mon, 2002-09-02 at 23:22, Robert Sherry wrote:
> >>> Elias,
> >>>
> >>>     I do not have any formal bench marks but, about 5 years ago,
> > I
> > bench
> >>> marked an Antlr generated scanner against a Lex generated
> > scanner.
> > I found
> >>> that the Antlr generated scanner ran at least as fast as the Lex
> > generated
> >>> scanner.
> >>>
> >>>
> >>>
> >>>     In addition, I have used both Yacc/Lex and Antlr.  I
> > personally believe
> >>> the Antlr is the better tool.
> >>>
> >>> In addition, it is better supported.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> Robert Sherry
> >>>
> >>> ----- Original Message -----
> >>> From: "Elias Biris" <user_sofia at b...>
> >>> Newsgroups: comp.compilers
> >>> Sent: Saturday, August 10, 2002 2:33 AM
> >>> Subject: ANTLR vs FLEX/BISON: performance issues?
> >>>
> >>>
> >>>> Hello,
> >>>>
> >>>>  I just discovered antlr and its earlier flavour, pccts.
> >>>>
> >>>>  I was wondering whether there is any published material,
> > preferably with
> >>>>  sample code, that atests for the performance characteristics 
of
> >>>>  lexers/parsers generated by antlr (primarily, I am also
> > interested in
> >>>>  similar material for pccts, if there is any) vs the same
> > lexer/parser as
> >>>>  generated by flex and bison.
> >>>>
> >>>>  Has anyone got any idea where to find something like that? All
> > tips and
> >>>>  pointers will be gratefully appreciated :-)
> >>>>
> >>>>  Thanks
> >>>>
> >>>>  Elias Biris
> >>>
> >>>
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to 
> > http://docs.yahoo.com/info/terms/
> >
> >
> --
> Co-founder, http://www.jguru.com
> Creator, ANTLR Parser Generator: http://www.antlr.org


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list