Closed
Bug 940817
Opened 11 years ago
Closed 8 years ago
Browsermark "JavaScript Array Weighted" is 1.6x slower than Chrome
Categories
(Core :: JavaScript Engine: JIT, defect, P4)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: cpeterson, Unassigned)
References
(Blocks 1 open bug)
Details
From Naveed's Browsermark "JavaScript Array Weighted" test results (bigger is better):
* Chrome 31 = 10,493
* Chrome 27 = 10,234
* Firefox 25 = 6,450
* Firefox 22 = 6,332
* IE11 = 8,569
Is this the same issue as Peacekeeper arrayWeighted bug 918746?
Reporter | ||
Updated•11 years ago
|
Component: General → JavaScript Engine: JIT
Comment 1•11 years ago
|
||
Peacekeeper arrayWeighted is:
> www.peacekeeper.therichins.net/js/tests/array/arrayWeighted.js
Browsermark arrayWeighted is:
> http://browsermark.rightware.com/tests/benchmarks/javascript/array_weighted/test.js
The tests are similar (one clearly copied from the other), but not identical. Browsermark's involves JQuery in the execution loop, while Peacekeeper's version is more straight-line.
Note that these JS tests should be ultra-low-priority, since reaching parity with Chrome does not have significant effect on Browsermark total score. Resources would be best put toward the graphics/html5_canvas and css/3d_rendering tests.
Reporter | ||
Updated•11 years ago
|
Priority: -- → P4
Comment 2•11 years ago
|
||
The majority of time is spent in test.js:112, on the following line:
> var chars = selectedCountry.splice(0, count).join("");
The code is attempting to get a string without the first |count| characters. It does so by splitting the initial string into a character array, calling splice() to remove the first |count| members of the array, and joining the characters back into a string.
Sigh.
V8 handles splice() better, probably because the temporary arrays always hit their nursery. Additionally, they have no performance penalty from the join() -- we could have similar behavior by using a RopeBuilder instead of StringBuffer in array_join().
Comment 3•11 years ago
|
||
Just in case someone from Browsermark is reading this bug, note that all the array nonsense can be replaced by the one-liner |str.substring(count)|.
Comment 4•8 years ago
|
||
Test case gone, and we have generational GC now.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•