Splice vs Push/Unshift (v10)

Revision 10 of this benchmark created on


Description

Examining which way of adding new elements into array

Setup

a = [], b = [], c = [], d = [];

Test runner

Ready to run.

Testing in
TestOps/sec
Splice add at top
a.splice(0,0,1)
 
ready
Unshift
b.unshift(1)
ready
Splice add at bottom
c.splice(c.length, 0, 1)
ready
Push
d.push(1)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.