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).
I remember Waldo playing with this code.
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.