This is a theoretical benchmark of require
time comparing ruby 1.9.4 r33453 original and patched on a 64-bit Linux with a sequential hard disk.
It is theoretical because it is based on requiring a few hundreds empty files from the same folder, which is likely rare.
However, the global result (patched significantly faster than original) should be reflected in a certain measure in real life.
It is showing especially good results, because a file is never required twice, and so the unpatched version always has to check every file loaded.
The patched version could actually be slower when:
- there are a lot of files loaded
- the user tries many times to require one of the first files loaded
But I could not confirm this in my benchmarks, and this case should never happen (because the first files loaded are loaded by ruby before running the code).
The benchmark was ran 20 times for each ruby. I also ran a manual benchmark on each ruby and the results are similar, it was just a bit faster on the original than expected.
Making good benchmarks is hard, so please teach me if I made a mistake. However, I'm confident about this one.
And, a big "thank you" to Yura Sokolov for this patch!
P.S.: The same benchmark ran on 1.8.7 can be seen at https://gist.github.com/1279106
I assume the axis is "time elapsed"?