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: Thu, 7 Sep 2006 23:59:58 -0400
User-agent: Mutt/1.5.11

On Thu, Sep 07, 2006 at 04:19:07PM -0700, Paul Eggert wrote:
> Bob Rossi <address@hidden> writes:
> 
> > Currently, push.c slows down the yacc parsing by between 2-8%, reported
> > by me and Akim.
> 
> Sounds a bit much, I'm afraid.  So we need a way of having straight
> traditional yacc parsing.

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?

It's been a while since I looked at the guts of the patch. I'll check
again why push-yacc takes so much longer than yacc-yacc.

> > I was just wondering if C++ people would use delete. Made me wonder
> > if we should write a pvvarsdestroy function.
> 
> Perhaps.  I don't use C++ so I'm the wrong guy to ask.  Akim can
> chime in here, perhaps.

OK, for now I'm going to assume the user has to do a free (). If anyone
objects, let me know.

> >> Is there any reason struct yypvars should be opaque?
> >
> > The only reason I made it opaque is because it seemed that never before
> > had any of the variables been visible in the global scope. When using
> > the pure parser, only 4 variable were made visible. Do you want me to
> > make them all visible?
> 
> I don't have a strong feeling about it.  However, if making it opaque
> hurts performance that's an argument for making it less opaque.  Stuff
> in the yy/YY namespace is "opaque" anyway.
> 
> > Here is the current timing info, what do you think?
> >
> >             Rate push-push yacc-yacc yacc-pure push-pure push-yacc
> > push-push 1.93/s        --      -30%      -31%      -32%      -34%
> > yacc-yacc 2.73/s       42%        --       -3%       -4%       -6%
> > yacc-pure 2.81/s       46%        3%        --       -1%       -3%
> > push-pure 2.85/s       48%        4%        1%        --       -2%
> > push-yacc 2.90/s       51%        6%        3%        2%        --
> 
> Sorry, I don't know what the numbers mean, or what things like
> "push-push" mean.

OK, I should have explained this better. There are 2 skeletons, push and
yacc. The push skeleton can produce a yacc, pure and push parser. By
default it does yacc, with %pure-parser it does pure, and with
%push-parser it does push. The yacc skeleton does yacc and pure.

yacc-yacc is the yacc skeleton using the default yacc parser.
yacc-pure is the yacc skeleton using the pure parser option. 
push-yacc is the push skeleton using the default yacc parser.
push-pure is the pure skeleton using the pure parser option.
push-push is the push skeleton using the push parser option.

I ran the calculater bench mark against all 5 of these generated
parsers, and ran the parser 50 times each. You can compare the timing of
any 2 parsers by selecting one from the column and one from the row. 

The most relevant timing info here is, 
yacc-yacc and push-yacc shows a 6% slow down in the push-yacc.
yacc-pure and push-pure shows a 1% slow down in the push-pure.

> > I could copy all the pure tests, and change the to push tests. What do
> > you think of that?
> 
> 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. 

> How much more time would this cause "make check" to take?  If it's
> not too bad, then duping the pure tests sounds fine.

I can't even figure out how to change the testsuite. Should I be
modifing the bison/tests/testsuite sh file? 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?

So, instead of seeing:
    Simple LALR(1) Calculator.
     82: Calculator                                   ok
     ...
     89: Calculator %pure-parser %locations           ok
     ...
     94: Calculator %pure-parser %error-verbose %debug %locations %defines 
%name-prefix=calc 
     95: Calculator %pure-parser %error-verbose %debug %locations %defines 
%name-prefix=calc

You would see:
    Simple LALR(1) Calculator.
     82: Calculator                                   ok
     ...
     89: Calculator %pure-parser %locations           ok
     90: Calculator %push-parser %locations           ok
     ...
     94: Calculator %pure-parser %error-verbose %debug %locations %defines 
%name-prefix=calc 
     95: Calculator %pure-parser %error-verbose %debug %locations %defines 
%name-prefix=calc
     96: Calculator %push-parser %error-verbose %debug %locations %defines 
%name-prefix=calc 
     97: Calculator %push-parser %error-verbose %debug %locations %defines 
%name-prefix=calc

Thanks for the help!
Bob Rossi




reply via email to

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