Re: Timings

Sorry, I accidentally sent this before I was finished.
One thing I wanted to remark, was that there are a lot of spaces in the 
base ixml: most lines are indented, so much of the difference between the 
no spaces and the spec ixml can be attributed to it being a much shorter 
file (64%), since even in the best case, for any parser, parsing time is 
linear in the length of the file.

I did one other test: the no spaces version, with "." removed as 
namefollower:

real 0m6.766s
user 0m6.737s
sys 0m0.030s


Steven

On Saturday 27 November 2021 10:50:15 (+01:00), Steven Pemberton wrote:

 > 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 10:03:10 UTC