Bug 15515 - New JavaScript benchmark
Summary: New JavaScript benchmark
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 523.x (Safari 3)
Hardware: All OS X 10.4
: P4 Normal
Assignee: Maciej Stachowiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-14 19:56 PDT by Maciej Stachowiak
Modified: 2007-10-15 18:40 PDT (History)
1 user (show)

See Also:


Attachments
Here's my first cut at this, SunSpider (36.23 KB, patch)
2007-10-14 20:07 PDT, Maciej Stachowiak
no flags Details | Formatted Diff | Diff
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 Details | Formatted Diff | Diff
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+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 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.
Comment 1 Maciej Stachowiak 2007-10-14 20:07:39 PDT
Created attachment 16672 [details]
Here's my first cut at this, SunSpider
Comment 2 Sam Weinig 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();
+    }

Comment 3 Sam Weinig 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.
Comment 4 Maciej Stachowiak 2007-10-14 22:05:03 PDT
Created attachment 16673 [details]
v2, addressing Sam's comments and with some browser compat fixes
Comment 5 Sam Weinig 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.



Comment 6 Sam Weinig 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.
Comment 7 Maciej Stachowiak 2007-10-14 23:13:02 PDT
Created attachment 16674 [details]
v3, fixing more of the mentioned issues plus more browser compat
Comment 8 Darin Adler 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