bison-patches
[Top][All Lists]
Advanced

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

Re: push parser implemenation


From: Bob Rossi
Subject: Re: push parser implemenation
Date: Fri, 8 Sep 2006 16:16:20 -0400
User-agent: Mutt/1.5.11

On Fri, Sep 08, 2006 at 12:44:47AM -0700, Paul Eggert wrote:
> Bob Rossi <address@hidden> writes:
> 
> > What's the minimum percentage of lost time that could be afforded in
> > order for me to merge the push skeleton into the yacc skeleton?
> 
> I'd like it to be low -- in the 1% or less range, anyway.

Ask, and you shall receive :)

            Rate push-push yacc-pure push-pure yacc-yacc push-yacc
push-push 3.04/s        --      -24%      -24%      -26%      -26%
yacc-pure 4.01/s       32%        --       -0%       -2%       -2%
push-pure 4.02/s       32%        0%        --       -2%       -2%
yacc-yacc 4.10/s       35%        2%        2%        --       -0%
push-yacc 4.10/s       35%        2%        2%        0%        --

That shows that 
    push-yacc is 0% slower than yacc-yacc
    push-pure is 0% slower than yacc-pure

The only catch, is that I compiled with -02. If you compile with out
optimizations it seems to be 1-2% slower, don't know why that is.

> >> OK, but I'd rather not make copies, but instead would rather reuse the
> >> original tests but make them parameterized.  But that should be fairly
> >> easy.
> >
> > I'm sorry, I'm not exactly sure what you mean here. 
> 
> The test suite is generated by Autotest.  It's a bunch of macro calls.
> Test cases are often generated by invoking a macro, with some arguments.
> You should be able to generate push-parser test cases by invoking
> those same macros (perhaps with slightly different args).  So
> there shouldn't be all that much change to the source code, even
> if the testsuite script grows a bit.

OK, thanks. I'll have to modify the test a little so that I can have
the test loop be:
  struct yypvars *ctx = yypvarsinit ();
  do {
    yychar_set (ctx, yylex ());
    yylval_set (ctx, yylval);
    yyparse (ctx);
  } while (yyresult_get (ctx) != 0);
  free (ctx);
instead of just 
  yyparse

> > Should I be
> > modifing the bison/tests/testsuite sh file?
> 
> You should be modifying the files that are checked into CVS,
> not the files that are generated from those.
> 
> > Running the push parser on a test takes the basicaly the same amount
> > of time to run the pure parser.  There is only 3 pure tests for the
> > yacc.c skeleton it looks like. Should I continue to test those 3
> > tests using the pure parser, and then run the same test using the
> > push parser option intead?
> 
> Yes, that sounds right.

Actually, I thought the LALR(1) was the yacc skeleton, but apparently it
is its own skeleton. Does bison not test the yacc skeleton against the 
Calculator example? If not, I don't have any nice tests to run. In this
case, what examples should I run the push parser against?

I'll post a patch soon, I just didn't want to waste anyone's time
looking at a patch I knew wasn't finished.

Thanks again,
Bob Rossi




reply via email to

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