bison-patches
[Top][All Lists]
Advanced

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

[PATCH 0/3] lalr skeletal changes: new symbol types


From: Theophile Ranquet
Subject: [PATCH 0/3] lalr skeletal changes: new symbol types
Date: Fri, 4 Jan 2013 13:55:21 +0100

Hi all,

I have taken some interest in the skeletons, recently.  For starters, here is
some rework on the LALR skeleton (a change to the container for the symbol
stack), and a change to the type of symbols, which should make some things a
bit clearer.

I ran some benchmarks. The results show no significant change in performance (a
slight drop, in the run pasted below), but this is not final and may get
better when we remove the spurious copies of semantic values, and replace them
by more approriate moves / swaps.

Grammar: list
  1. %skeleton "lalr1.cc" %define variant /* %bison "~/old-bison/bin/bison"\ */
  2. %skeleton "lalr1.cc" %define variant /* %bison "~/new-bison/bin/bison"\ */
Benchmark: timing 10000 iterations of 1, 2...
         1: 58.4218 wallclock secs (14.42 cusr + 15.74 csys = 30.16 CPU) @ 
331.56/s (n=10000)
         2: 64.062 wallclock secs (13.24 cusr + 18.91 csys = 32.15 CPU) @ 
311.04/s (n=10000)
   Rate   2   1
2 311/s  -- -6%
1 332/s  7%  --
Sizes (decreasing):
         1: 37.14kB
         2: 26.85kB

There is a "(void) v; /* FIXME: */" in the code.  This is to avoid an error on
situations where variants are used, but no types were provided by the user.
AFAIK, we do not yet have any mean to check this (at M4-level).  I shall
investigate this.

There might also be way for stylistic improvements in my m4.

Theophile Ranquet (3):
  lalr1.cc: change symbols implementation
  variants: minor improvements
  lalr1.cc: use a vector for the symbol stack

 data/c++.m4     | 197 ++++++++++++++++++++++++++++----------------------------
 data/lalr1.cc   | 102 ++++++++++++++---------------
 data/stack.hh   |  12 ++--
 data/variant.hh |   7 ++
 4 files changed, 162 insertions(+), 156 deletions(-)

-- 
1.8.1




reply via email to

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