rpcalc grammar takes a long time to generate a parser for. Why?

Original time: 52.255 seconds

Isolated speed-up measures
--------------------------

1. Memoizing firstofstring
 Time: 25.076 seconds (52% reduction)
 Tests run without problems!

2. Memoizing lr1_closure
 Time: 34.620 seconds
 Tests do not run without problems!

3. Hash in lookaheads to avoid repeated calls to lr0_goto
 Time: 34.179 seconds
 Tests run without problems!

4. Inclusion hash updated directly in lr1_closure
 Time: 7.711 seconds
 Tests run without problems!

Combined speed-up measures
--------------------------

C1. Combining 1 and 3 above:
 Time: 9.954 seconds
 Tests run without problems!

C2. Combining 1, 3 and 4 above:
 Time: 3.004 seconds
 Tests run without problems!

Profile C1
----------
lr1_closure w/o firstofstring: 10.3 seconds
firstofstring:                 5.65 seconds
lookaheads:                    0.69 seconds

and a total of:                17.305 seconds

Conclusion
----------
Combining these simple measures give an acceptable speed-up. Its now only double the time (1.241 seconds) of an equivalent grammar without left recursion. Its acceptable even though there is plenty of room to speed this up even more...
