Skip to content

Improve JS array manipulation performance #509

Description

@classilla

With https://bugzilla.mozilla.org/show_bug.cgi?id=1348772 adapted to 45,

before

time /home/spectre/Desktop/TenFourFoxDebug.app/Contents/MacOS/js -f tests/basic/shifted-elements4.js
40.491u 0.273s 0:40.73 100.0%   0+0k 0+3io 0pf+0w

after

time ../../../obj-ff-dbg/dist/bin/js -f tests/basic/shifted-elements4.js
0.455u 0.294s 0:00.71 104.2%    0+0k 0+0io 0pf+0w

This is something like an 89x speedup on Array.push(). We should implement the unshifting optimization for the other major ops.

https://bugzilla.mozilla.org/show_bug.cgi?id=1364346 unshift
https://bugzilla.mozilla.org/show_bug.cgi?id=1364345 splice (may or may not need https://bugzilla.mozilla.org/show_bug.cgi?id=1362753 )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions