Closed Bug 919658 Opened 11 years ago Closed 10 years ago

Array literals slower than v8

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

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?
If we want to do COWs we should really wait for the real elements/object refactoring that is going to happen at some point.
Status: NEW → RESOLVED
Closed: 10 years ago
Depends on: 934450
Resolution: --- → FIXED
Assignee: nobody → bhackett1024
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.