help-bison
[Top][All Lists]
Advanced

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

Re: C versus C++ parser performance


From: Hans Aberg
Subject: Re: C versus C++ parser performance
Date: Fri, 2 Feb 2007 15:10:58 +0100

On 2 Feb 2007, at 09:53, Geoffrey D Alexander wrote:

I have a C parser (using the C skeleton) that contains C++ code that I'm compiling with g++. The parser works fine. But a previous thread titled "bison and C++" from December 2006 said that compiling C parsers with a
C++ compiler is no longer support.  So, I converted my compiler to use
the C++ skeleton.  Functionally, this worked fine.  The new C++ parser
produces the same output as the old C-based parser.

However, I did notice a slowdown of 5 to 20 percent in the C++ parser.
Also, the C++ parser shows an increase of 10 to 15 percent in the number
of memory allocation as reported by valgrind.

Is this a known problem?  Are there plan to improve C++ parser
performance?

People do not bother about such things, as typically, the parser does not take up much time in a compiler/interpreter: most time is spent in the lexer and the actions. In addition, memory is ample nowadays. So, for example, LR(1) becomes feasible but, which may blow up memory several times relative the LALR(1) that Bison uses.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]