Timings

I had noticed that ambiguity slows down parsing a lot, and so I wondered to 
what extent near ambiguity had an effect.
What do I mean with near ambiguity? Well, "." is a namefollower character, 
so with rules like

    a: b, c.
    d: e, f.

it's not until the parser sees the "d" that it knows that "c." is not a 
name, but a name followed by a dot.

So I created a number of versions of ixml: 
1. Removing "." as a namefollower.
2. With a space between every token.
3. With no spaces (linefeeds were kept).


Times (remember that this is an interpreted language, so numbers will be 
quite high):

ixml straight out of the spec: 
real 0m15.740s
user 0m15.722s
sys 0m0.017s

ixml without . as a namefollower
real 0m12.817s
user 0m12.800s
sys 0m0.016s

extra spaces:
real 0m12.288s
user 0m12.268s
sys 0m0.020s

No spaces:
real 0m7.169s
user 0m7.135s
sys 0m0.033s

Received on Saturday, 27 November 2021 09:50:30 UTC