We need a new JavaScript benchmark. We have the following requirements: - Freely redistributable. - Works without having to set up a special web server. - Command-line (pure js) and browser-hosted versions. - Lets you tell whether changes over time are statistically meaningful (even for small differences). - Gives meaningful cross-browser comparisons. - Has test content that reasonably reflects real-world use of JavaScript. - Covers a wide range of JavaScript features and constructs. - Suitable for integration with our automated testing.
Created attachment 16672 [details] Here's my first cut at this, SunSpider
I think you are going to leak the the fileName in the null script case. + case Load: + { + char* fileName = strdup(args[0]->toString(exec).UTF8String().c_str()); + char* script = createStringWithContentsOfFile(fileName); + if (!script) + return throwError(exec, GeneralError, "Could not open file."); + + exec->dynamicInterpreter()->evaluate(fileName, 0, script); + + free(script); + free(fileName); + + return jsUndefined(); + }
A few notes. The following files contain tabs. SunSpider/make-hosted SunSpider/sunspider SunSpider/hosted/sunspider-driver.html SunSpider/tests/math-cordic.js SunSpider/hosted/sunspider-record-result.js needs a newline at the end. In SunSpider/resources/TEMPLATE.html: The opening tag should be a pre. +<div id="console"> +</pre> The tests need some sort of license or credit.
Created attachment 16673 [details] v2, addressing Sam's comments and with some browser compat fixes
More little notes. The following are missing a start <html> tag: SunSpider/hosted/sunspider-driver.html SunSpider/hosted/sunspider-results.html SunSpider/hosted/sunspider.html SunSpider/resources/TEMPLATE.html SunSpider/hosted/sunspider-driver.html still has a tab.
As noted in IRC, you may also want to make the generated arrays not end in a comma, though this does not seem to be a problem, it could present itself as one later.
Created attachment 16674 [details] v3, fixing more of the mentioned issues plus more browser compat
Comment on attachment 16674 [details] v3, fixing more of the mentioned issues plus more browser compat Looks like a good start. r=me