str_split shouldn't have to use JS_SetElement to fill in the array

RESOLVED FIXED

Status

()

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: bzbarsky, Assigned: Waldo)

Tracking

({perf})

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

If it could call something like js_ArrayCompPush (which perhaps needs renaming and maybe needs the length check removed) or array_push1_dense that would be somewhat faster (6% win on the dromaeo string split test).

The question Jason and I had is why the INDEX_TOO_BIG check in array_push1_dense (via INDEX_TOO_SPARSE) is present and whether js_ArrayCompPush should replace the check it currently does with a similar check (and get renamed to js_DenseArrayPush along the way).

Comment 1

9 years ago
I remember Waldo playing with this code.
(Assignee)

Updated

9 years ago
Assignee: general → jwalden+bmo
(Assignee)

Comment 2

9 years ago
Fixed in bug 538690 by using js::AutoValueVector to build up a vector of contents, then build the array all at once in the end from that vector.  It's possible it would be even faster to build directly into the array, but the complexity of pushing onto an array (handling dense->slow transitions, slots resizing, etc.) makes me less than certain it would be much of a win, if it even were a win.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.