[Top][All Lists]

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

C versus C++ parser performance

From: Geoffrey D Alexander
Subject: C versus C++ parser performance
Date: Fri, 02 Feb 2007 03:53:16 -0500

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

In case it helps in pinpointing the cause of the slowdown, here a
details of how I build my parser :

      * Bison 2.3, using %locations and %pure-parser
      * Flex 2.5.33, C scanner compiled with g++ using bison-locations,
        full, reentrant, and yylineno options
      * g++ 4.1.2 20061115 (prerelease) (SUSE Linux), using -O3 option
      * SuSE Linux x86_64 10.2
      * Custom built Intel Core 2 Extreme X6800 based PC with 2GB RAM

Please let me know if any additional information will help.

Geoff Alexander

reply via email to

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