Closed
Bug 919658
Opened 11 years ago
Closed 10 years ago
Array literals slower than v8
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: jandem, Assigned: bhackett1024)
References
Details
Peacekeeper's arrayWeighted test (see bug 918746) has a "run" function that's called many times. This function has 24 array literals with constant string values and we keep allocating + initializing objects and elements.
V8 also allocates a new object for every literal but they store a constant, copy-on-write elements pointer so they don't have to allocate + fill the elements (as long as the elements are not modified).
Although GGC will make object and elements allocation faster (no more malloc for larger arrays), we still have to write the ObjectElements header and all elements. Furthermore, allocating elements will fill up the nursery resulting in more minor GCs.
Adding COW ObjectElements is not trivial and I don't know other tests that need this. However, if we want to compete with V8 on peacekeeper we need to do something more efficient than what we're doing now. Thoughts?
Comment 1•11 years ago
|
||
If we want to do COWs we should really wait for the real elements/object refactoring that is going to happen at some point.
Comment 2•10 years ago
|
||
Turns out Octane Splay also needed it: http://arewefastyet.com/#machine=11&view=single&suite=octane&subtest=Splay&start=1408512056&end=1408516313
Nicely fixed by bug 934450.
Updated•10 years ago
|
Assignee: nobody → bhackett1024
Target Milestone: --- → mozilla34
You need to log in
before you can comment on or make changes to this bug.
Description
•