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)

defect

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?
Component: General → JavaScript Engine: JIT
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.
Priority: -- → P4
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().
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)|.
Depends on: 943126
Depends on: 939115
No longer depends on: 939115
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.