help-bison
[Top][All Lists]
Advanced

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

Re: Slow compilation


From: Laurence Finston
Subject: Re: Slow compilation
Date: Fri, 20 Aug 2004 17:11:43 +0200 (MEST)

On Fri, 20 Aug 2004, Mike Aubury wrote:

> Is it the bison bit that takes the time (compile of the grammer) or the gcc of
> the resultant C file ?
>

Bison runs quite fast, it's the compilation with `g++'.  I use C++ in the
actions, but I don't generate a C++ parser class.

> Have you got any optimization switches for the compile (these can add huge
> amounts to the compile time) ?
> What about debugging ( gcc -g)

This is what I was using:

g++ -c -g -O2 -frepo -pthread parser.c++

I've just tried this:

g++ -c parser.c++

and it worked!  Compilation only took a few seconds.  Thanks a lot!  GDB
doesn't work well when I'm using threads, anyway, so I don't really need
`-g'.

Laurence

>
> On Friday 20 August 2004 15:17, Laurence Finston wrote:
> > Thanks for your response.
> > Do you have any suggestions for fixing the problem?  The other files
> > compile reasonably fast, so I don't think it's the compilation environment
> > that's causing the problem.
> >
> > Laurence
> >
> > On Fri, 20 Aug 2004, David Fletcher wrote:
> > > Hi,
> > >
> > > >>>>> "LF" == Laurence Finston <address@hidden> writes:
> > >
> > > LF> ... while compilation is now somewhat faster, it still takes about
> > > LF> 5 minutes on a fast workstation with two processors and not much
> > > LF> competition from other users at present.
> > >
> > > LF> My parser now contains 508 rules and 755 states...
> > >
> > > LF> Is it reasonable that compilation should take so long?
> > >
> > > Sounds like there's something odd happening.
> > >
> > >
> > > I have a grammar that has 638 rules.  When processed with an older
> > > version of bison, a parser with 1228 states is produced.  To run
> > > bison, compile the code using g++, and link takes about 5 or 6
> > > seconds.
> > >
> > > This is on a 2-year old dual-processor Athlon 2800 machine with 1GB of
> > > RAM, running SuSE linux 9.1.
> > >
> > > HTH
> > >
> > > --
> > > David Fletcher                          Tuscany Design Automation, Inc.
> > > address@hidden                     5875 S. Danube Circle
> > > 303.690.4309                            Aurora, CO 80015-3169 USA
> >
> > _______________________________________________
> > address@hidden http://lists.gnu.org/mailman/listinfo/help-bison
>




reply via email to

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