dcsimg
ANTLR parser speed perfomance
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   merom_klein
Posted On:   Tuesday, May 8, 2001 07:26 AM

i checked the speed performances of a c++ parser which was generated by ANTLR this is a partial parser for parsing MEGACO protocol i have checked it with the Microsoft visual c++ profiler then i checked a different c++ parser which was created by anagram tool although it is c++ it is infact c with small improvments of c++. i also checked this parser with the same profiler. i turned out that the ANAGRAM parser was much more faster. my final objective is to take whatever parser and embed it in my PSOS system. this is the reason why speed performance is so important to me. my question is : 1.is there any possibility to speed up ANTLR C++ perf   More>>

i checked the speed performances of a c++ parser which was generated by ANTLR
this is a partial parser for parsing
MEGACO protocol
i have checked it with the Microsoft
visual c++ profiler
then i checked a different c++ parser
which was created by anagram tool
although it is c++ it is infact c with
small improvments of c++.
i also checked this parser with the same
profiler.
i turned out that the ANAGRAM parser was
much more faster.
my final objective is to take whatever parser and embed it in my PSOS system.
this is the reason why speed performance
is so important to me.
my question is : 1.is there any possibility to speed up ANTLR C++ performance
2. do you have a tool for creating pure
c ANTLR parser which could be ported
easily to PSOS.
the choice i'm about to make of which
parser generator to use is dependant on
an answer to that question.
sincerely
meromEnter your full question here

   <<Less

Re: ANTLR parser speed perfomance

Posted By:   Ric_Klaren  
Posted On:   Wednesday, May 9, 2001 02:22 AM

I have some incomplete patches to speed up some aspects of the support library. Though not the time atm to incorporate/port those.

Speed ups can be gotten by keeping things:


  • LL(1).
  • Don't use a ANTLR lexer but flex or similar
    (I'm not 100% sure if this helps, but if my hunch is true than you might gain a lot there).
  • Don't use semantic checks or limit them to rules near the end of your parse tree. Every semantic action introduces backtracking/extra recursion in the rule itself and in the rules below.
  • Turn of AST generation.

There is no C codegenerator. But making one shouldn't be that hard (if you have time).

If you are willing to share the results of your profiling work I'd be much obliged btw.

About | Sitemap | Contact