[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: push parser implemenation
From: |
Akim Demaille |
Subject: |
Re: push parser implemenation |
Date: |
Fri, 7 Apr 2006 15:51:20 +0200 |
Le 7 avr. 06 à 14:42, Akim Demaille a écrit :
Benchmark: timing 50 iterations of push-pure, push-push, push-yacc,
yacc-pure, yacc-yacc...
push-pure: 64 wallclock secs ( 0.00 usr 0.07 sys + 45.05 cusr
1.36 csys = 46.48 CPU) @ 714.29/s (n=50)
push-push: 77 wallclock secs ( 0.00 usr 0.07 sys + 50.53 cusr
1.56 csys = 52.16 CPU) @ 714.29/s (n=50)
push-yacc: 66 wallclock secs ( 0.00 usr 0.07 sys + 45.51 cusr
1.40 csys = 46.98 CPU) @ 714.29/s (n=50)
yacc-pure: 55 wallclock secs ( 0.00 usr 0.07 sys + 36.98 cusr
1.25 csys = 38.30 CPU) @ 714.29/s (n=50)
yacc-yacc: 54 wallclock secs ( 0.00 usr 0.07 sys + 38.12 cusr
1.23 csys = 39.42 CPU) @ 714.29/s (n=50)
Rate push-push yacc-yacc yacc-pure push-pure push-yacc
push-push 714/s -- 0% 0% 0% -0%
yacc-yacc 714/s 0% -- 0% 0% -0%
yacc-pure 714/s 0% 0% -- 0% -0%
push-pure 714/s 0% 0% 0% -- -0%
push-yacc 714/s 0% 0% 0% 0% --
I confess I don't understand the table output by this Perl module
here. What is this "rate"?
Now (that I read the code) I have it: to compute the rate, it sums
the usr and sys time for the parent (i.e., the call to "system")
which is consistenly 0.07 here for the 50 iterations. Hence, a
"rate" of 50/0.07 / 714,285714285714.
If I change the cmpthese call into "cmpthese ($res, 'nop')" (nop
stands for noparents), and similarly for timethese, then I have
better results:
No optimization:
Benchmark: timing 50 iterations of push-pure, push-push, push-yacc,
yacc-pure, yacc-yacc...
push-pure: 64 wallclock secs (45.00 cusr + 1.26 csys = 46.26 CPU) @
1.08/s (n=50)
push-push: 66 wallclock secs (50.38 cusr + 1.21 csys = 51.59 CPU) @
0.97/s (n=50)
push-yacc: 68 wallclock secs (45.49 cusr + 1.30 csys = 46.79 CPU) @
1.07/s (n=50)
yacc-pure: 57 wallclock secs (36.95 cusr + 1.17 csys = 38.12 CPU) @
1.31/s (n=50)
yacc-yacc: 57 wallclock secs (38.06 cusr + 1.17 csys = 39.23 CPU) @
1.27/s (n=50)
Rate push-push push-yacc push-pure yacc-yacc yacc-pure
push-push 0.969/s -- -9% -10% -24% -26%
push-yacc 1.07/s 10% -- -1% -16% -19%
push-pure 1.08/s 12% 1% -- -15% -18%
yacc-yacc 1.27/s 32% 19% 18% -- -3%
yacc-pure 1.31/s 35% 23% 21% 3% --
(as an aside, there is no point in not using pure parsers: they are
slightly faster. But I'm on a PPC, so I wouldn't be surprised if
more stuff be kept in registers, hence easily beating global
variables... Maybe the figures would be different on Intel chips).
With -O2:
Benchmark: timing 50 iterations of push-pure, push-push, push-yacc,
yacc-pure, yacc-yacc...
push-pure: 30 wallclock secs (20.94 cusr + 0.88 csys = 21.82 CPU) @
2.29/s (n=50)
push-push: 34 wallclock secs (22.96 cusr + 0.95 csys = 23.91 CPU) @
2.09/s (n=50)
push-yacc: 30 wallclock secs (21.47 cusr + 0.91 csys = 22.38 CPU) @
2.23/s (n=50)
yacc-pure: 26 wallclock secs (17.78 cusr + 0.85 csys = 18.63 CPU) @
2.68/s (n=50)
yacc-yacc: 25 wallclock secs (18.50 cusr + 0.85 csys = 19.35 CPU) @
2.58/s (n=50)
Rate push-push push-yacc push-pure yacc-yacc yacc-pure
push-push 2.09/s -- -6% -9% -19% -22%
push-yacc 2.23/s 7% -- -3% -14% -17%
push-pure 2.29/s 10% 3% -- -11% -15%
yacc-yacc 2.58/s 24% 16% 13% -- -4%
yacc-pure 2.68/s 28% 20% 17% 4% --
For fun, -O3:
Benchmark: timing 50 iterations of push-pure, push-push, push-yacc,
yacc-pure, yacc-yacc...
push-pure: 26 wallclock secs (17.99 cusr + 0.84 csys = 18.83 CPU) @
2.66/s (n=50)
push-push: 28 wallclock secs (19.84 cusr + 0.86 csys = 20.70 CPU) @
2.42/s (n=50)
push-yacc: 27 wallclock secs (18.46 cusr + 0.89 csys = 19.35 CPU) @
2.58/s (n=50)
yacc-pure: 22 wallclock secs (15.88 cusr + 0.82 csys = 16.70 CPU) @
2.99/s (n=50)
yacc-yacc: 22 wallclock secs (16.43 cusr + 0.81 csys = 17.24 CPU) @
2.90/s (n=50)
Rate push-push push-yacc push-pure yacc-yacc yacc-pure
push-push 2.42/s -- -7% -9% -17% -19%
push-yacc 2.58/s 7% -- -3% -11% -14%
push-pure 2.66/s 10% 3% -- -8% -11%
yacc-yacc 2.90/s 20% 12% 9% -- -3%
yacc-pure 2.99/s 24% 16% 13% 3% --
sulaco-eth% gcc --version
powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer, Inc.
build 5026)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
- Re: push parser implemenation, (continued)
- Re: push parser implemenation, Frans Englich, 2006/04/05
- Re: push parser implemenation, Bob Rossi, 2006/04/05
- Re: push parser implemenation, Frans Englich, 2006/04/05
- Re: push parser implemenation, Bob Rossi, 2006/04/05
- Re: push parser implemenation, Frans Englich, 2006/04/05
- Re: push parser implemenation, Bob Rossi, 2006/04/05
Re: push parser implemenation, Akim Demaille, 2006/04/07
- Re: push parser implemenation,
Akim Demaille <=
- Re: push parser implemenation, Bob Rossi, 2006/04/07
- Re: push parser implemenation, Akim Demaille, 2006/04/07
- Re: push parser implemenation, Bob Rossi, 2006/04/07
- Re: push parser implemenation, Bob Rossi, 2006/04/07
- Re: push parser implemenation, Akim Demaille, 2006/04/20
- Re: push parser implemenation, Akim Demaille, 2006/04/20
Re: push parser implemenation, Bob Rossi, 2006/04/07
Re: push parser implemenation, Bob Rossi, 2006/04/07
Re: push parser implemenation, Bob Rossi, 2006/04/08