Bug 15515

Summary: New JavaScript benchmark
Product: WebKit Reporter: Maciej Stachowiak <mjs>
Component: Tools / TestsAssignee: Maciej Stachowiak <mjs>
Status: RESOLVED FIXED    
Severity: Normal CC: sam
Priority: P4    
Version: 523.x (Safari 3)   
Hardware: All   
OS: OS X 10.4   
Attachments:
Description Flags
Here's my first cut at this, SunSpider
none
v2, addressing Sam's comments and with some browser compat fixes
none
v3, fixing more of the mentioned issues plus more browser compat darin: review+

Maciej Stachowiak
Reported 2007-10-14 19:56:55 PDT
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.
Attachments
Here's my first cut at this, SunSpider (36.23 KB, patch)
2007-10-14 20:07 PDT, Maciej Stachowiak
no flags
v2, addressing Sam's comments and with some browser compat fixes (44.14 KB, patch)
2007-10-14 22:05 PDT, Maciej Stachowiak
no flags
v3, fixing more of the mentioned issues plus more browser compat (44.10 KB, patch)
2007-10-14 23:13 PDT, Maciej Stachowiak
darin: review+
Maciej Stachowiak
Comment 1 2007-10-14 20:07:39 PDT
Created attachment 16672 [details] Here's my first cut at this, SunSpider
Sam Weinig
Comment 2 2007-10-14 20:17:44 PDT
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(); + }
Sam Weinig
Comment 3 2007-10-14 20:41:39 PDT
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.
Maciej Stachowiak
Comment 4 2007-10-14 22:05:03 PDT
Created attachment 16673 [details] v2, addressing Sam's comments and with some browser compat fixes
Sam Weinig
Comment 5 2007-10-14 22:34:46 PDT
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.
Sam Weinig
Comment 6 2007-10-14 22:36:02 PDT
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.
Maciej Stachowiak
Comment 7 2007-10-14 23:13:02 PDT
Created attachment 16674 [details] v3, fixing more of the mentioned issues plus more browser compat
Darin Adler
Comment 8 2007-10-15 09:11:17 PDT
Comment on attachment 16674 [details] v3, fixing more of the mentioned issues plus more browser compat Looks like a good start. r=me
Note You need to log in before you can comment on or make changes to this bug.