RESOLVED FIXED 43256
Avoid timing IO in SunSpider
https://bugs.webkit.org/show_bug.cgi?id=43256
Summary Avoid timing IO in SunSpider
Paul Biggar
Reported 2010-07-30 09:24:14 PDT
In the standalone shell version of Sunspider, the timer is started, then load() is called on the script, and finally the timer is stopped. load() reads the file from disk, and the IO effect of this leads to a 35% increase in variance (see https://bugzilla.mozilla.org/show_bug.cgi?id=580532#c24). The simplest solution is to read the file into a string, then start the timer, eval the string, and stop the timer. I'm told most JS engines have a read() builtin function for this (though on Firefox it is called snarf() for some reason).
Attachments
Use eval() and read() instead of load() (963 bytes, patch)
2010-08-06 14:14 PDT, Paul Biggar
no flags
Paul Biggar
Comment 1 2010-08-06 14:14:46 PDT
Created attachment 63759 [details] Use eval() and read() instead of load() Use read() and eval() instead of load(). Currently, only v8 supports read(), but I'm adding it to SpiderMonkey, and it is a simple change to jsc, as far as I can tell.
Paul Biggar
Comment 2 2011-02-11 10:25:53 PST
This is indirectly fixed here: 2010-11-29 Geoffrey Garen <ggaren@apple.com> Improved accuracy of command-line SunSpider. Since run() loads the file before the timer is started, there's no need for this patch.
Note You need to log in before you can comment on or make changes to this bug.