This is the mail archive of the
mailing list for the GCC project.
Re: Some (small) c++ compilation profiling data (oprofile)
- From: dewar at gnat dot com (Robert Dewar)
- To: levon at movementarian dot org, mark at codesourcery dot com,zack at codesourcery dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 21 May 2002 05:07:14 -0400 (EDT)
- Subject: Re: Some (small) c++ compilation profiling data (oprofile)
> Note that the new parser has not been tuned for speed *at all*. Heck,
> I didn't even do the usual operator precedence stuff; we do the full
> recursion for expressions in the naive way you would if you typed in
> the C++ grammar directly.
I don't think that's such a bad idea, procedure calls are pretty cheap,
and I doubt this is a source of any significant inefficiency. After all
big complex expressions with multiple precedence levels are not common
anyway statistically in most code. GNAT certainly does the same thing
and does not mess with operator precedence. It's really a cleaner
structure. Basic parsing (in the text book sense, no semantic analysis)
using recursive descent should be an order of magnitude faster than
lexical analysis anyway in practice.