jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Speed comparisons between slice, splice, for, Array using a strict integer array
<!-- script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script -->
var a = [74,65,65,209,65,97,10,226,52,146,14,12,176,215,135,176,103,71,2,171,238,111,96,176,184,44,181,11,18,78,247,6,191,253,239,134,73,146,224,188,188,195,143,111,52,206,187,102,100,126,34,0,188,168,175,55,14,160,5,69,149,132,40,191,3,51,155,1,8,220,128,159,175,30,88,67,139,232,217,207,196,92,168,227,79,8,222,25,211,175,63,45,26,227,178,37,200,106,57,172,119,36,212,36,59,239,140,37,69,134,219,141,252,70,106,35,148,19,95,164,73,241,231,51,153,78,247,162,168,88,115,62,109,144,240,72,241,213,105,181,209,100,112,119,57,94,239,169,95,171,197,180,36,108,125,213,163,247,3,224,237,243,135,192,124,73,241,9,43,106,151,194,245,68,77,71,152,101,70,216,71,27,240,185,142,137,169,128,149,184,62,53,12,73,207,31,174,210,129,212,6,124,237,85,144,148,251,201,107,211,65,61,19,15,125,157,245,145,37,10,227,172,171,128,151,7,58,55,3,89,42,250,214,169,163,139,56,20,151,152,183,251,220,118,55,227,241,141,35,122,16,94,43,159,130,135,171,128,240,22,236,201,125,204,241,116,19,2,165,121,179,241,134,57,229,53,192,51,192,181,32,230,65,238,140,164,225,40,3,233,238,69,167,58,1,49,250,230,163,251,55,70,71,153,68,84,147,53,131,128,238,178,19,90,230,133,99,9,3,154,102,187,103,201,144,199,209,152,160,152,108,111,65,179,191,188,106,1,155,120,127,45,247,16,201,53,196,107,75,168,143,107,116,248,119,244,145,65,31,229,113,91,43,82,156,220,1,67,137,48,253,71,72,185,145,213,237,53,47,53,122,13,45,189,125,49,176,23,136,175,210,117,158,193,222,196,142,114,155,113,183,99,235,3,186,39,95,97,199,159,150,167,139,110,111,242,198,140,120,184,108,76,65,113,13,93,79,12,252,160,176,25,66,34,25,74,14,6,35,170,207,57,60,177,250,240,122,17,126,31,28,196,45,6,77,36,175,230,65,72,88,189,237,46,139,212,139,28,116,11,150,181,175,100,200,60,141,82,154,238,30,172,130,229,163,75,245,10,31,140,146,5,72,53,127,124,47,22,188,142,62,92,207,203,138,189,87,79,119,4,127,157,137,103,196,73,72,133,126,239,221,77,1,82,75,112,213,167,137,185,61,204,177,141,61,8,138,155,20,136,160,230,18,90,33,165,5,36,82,114,33,203,243,96,113,36,231,193,179,44,50,74,25,13,112,141,221,19,2,81,48,34,197,37,118,149,65,23,221,42,133,119,194,219,193,27,115,160,192,118,44,150,247,87,186,73,236,39,92,241,127,194,166,168,198,118,90,105,186,149,233,207,242,69,19,216,54,51,19,119,69,93,239,57,6,70,71,227,249,183,121,188,16,26,126,55,13,250,123,41,252,164,215,63,121,44,15,12,232,144,167,58,176,196,207,107,111,235,144,25,234,157,97,241,244,198,169,65,15,95,13,219,17,119,27,23,213,59,150,238,140,41,117,39,119,138,109,1,1,229,56,69,162,189,152,171,67,106,48,23,103,133,206,254,45,222,99,20,48,73,143,47,242,32,139,178,26,215,251,63,66,216,211,45,165,64,12,62,216,205,154,96,208,63,7,84,95,222,26,5,190,215,220,184,102,213,176,240,235,160,199,101,96,246,215,122,0,129,207,24,45,252,146,86,187,232,151,119,55,55,124,147,16,194,207,105,220,29,102,68,34,130,142,188,5,149,123,255,42,8,91,131,214,219,153,247,88,159,202,188,19,15,28,8,195,238,95,69,254,173,216,231,42,57,255,35,82,250,224,113,253,230,62,21,109,176,48,212,247,155,41,107,229,37,155,177,18,123,51,21,130,149,58,237,162,247,114,235,138,208,44,94,172,229,193,105,60,154,20,91,219,121,135,79,211,57,75,146,36,11,167,58,167,37,249,11,82,192,3,190,77,223,251,185,73,234,102,178,129,245,172,166,90,72,100,166,192,214,19,189,26,216,189,103,147,28,67,9,68,130,21,83,62,192,64,102,202,49,87,218,238,57,174,16,186,108,222,14,89,55,198,38,129,111,246,174,142,247,113,95,246,238,84,205,56,109,250,174,154,76,113,232,144,9,72,169,56,248,164,185,137,252,204,246,161,135,73,171,193,230,165,191,219,176,215,217,13,17,194,3,231,101,187,242,115,214,110,155,231,115,145,238,37,227,81,211,152,117,7,100,18,65,96,207,86,220,95,80,54,229,72,157,109,241,210,105,103,92,20,253,77,88,98,118,228,133,164,127,179,176,251,224,236,126,74,33,197,232,6,45,83,152,15,197,158,67,154,95,245,98,237,210,143,200,218,110,139,196,30,128,24,1,175,131,229,158,57,230,163,112,226,27,21,40,2,153,115,59,151,229,150,85,107,190,175,91,117,152,174,196,251,147,244,33,79,127,137,32,20,157,242,199,45,182,31,76,114,159,184,143,43,224,246,20,40,152,206,21,166,213,79,93,185,139,128,243,246,148,117,246,108,92,14,39,229,30,178,14,7,228,99,251,188,17,162,88,96,146,241,175,143,40,186,153,204,148,171,76,215,7,155,132,35,76,38,171,45,64,126,80,122,252,157,218,83,253,157,113,4,127,32,209,155,152,119,240,36,16,174,162,155,84,159,236,111,206,17,193,159,213,151,28,85,44,163,49,98,213,132,75,140,91,153,14,41,180,7,201,232,205,90,182,11,167,54,93,19,102,185,233,226,74,111,224,148,82,145,161,234,60,186,21,217,156,183,11,85,222,145,130,234,123,251,241,233,14,30,28,217,192,149,184,142,123,246,244,253,58,200,65,57,82,239,212,251,154,206,60,138,103,57,185,205,98,21,77,253,3,61,56,144,7,103,27,218,220,165,59,32,241,207,111,139,137,145,1,113,20,228,234,221,159,101,161,191,222,114,95,141,169,86,231,171,127,51,233,92,163,9,54,31,64,22,194,121,154,213,104,39,130,165,74,161,88,174,102,92,235,227,71,11,229,41,218,195,32,20,77,199,29,17,224,74,158,180,36,178,34,255,213,160,75,245,134,15,24,252,173,201,120,189,149,35,45,108,143,56,84,248,5,153,64,115,244,213,1,195,151,99,199,171,175,241,30,118,33,248,45,165,212,214,94,80,250,243,173,117,232,57,168,2,7,78,14,247,95,245,197,132,165,12,62,56,132,199,186,228,124,133,155,10,73,193,28,232,115,52,145,11,246,2,244,186,227,167,77,126,42,141,67,205,30,104,220,23,180,152,192,64,202,229,248,217,117,52,98,244,101,169,102,122,78,174,216,147,225,198,154,99,152,143,23,24,145,222,126,210,203,25,93,91,170,49,94,162,101,120,3,134,176,84,24,74,91,115,199,220,2,96,141,80,149,17,54,232,204,150,82,151,212,255,49,37,166,13,33,111,85,156,207,54,242,219,210,94,142,238,217,58,2,201,189,168,220,223,38,240,252,104,30,44,238,187,152,56,157,116,33,97,79,17,153,148,131,255,234,88,248,224,174,230,68,55,149,45,63,114,245,178,89,85,175,135,196,103,57,81,234,46,55,195,55,196,20,74,237,141,177,168,247,8,247,84,97,61,167,41,99,6,28,184,32,176,61,13,115,252,35,223,222,147,122,141,116,119,171,71,61,207,65,76,15,66,175,59,218,252,178,160,9,132,245,216,87,187,101,96,73,179,237,141,106,185,36,83,123,146,69,25,198,61,38,43,148,200,205,244,206,121,115,81,31,189,6,126,97,220,2,13,125,75,45,54,131,169,82,8,47,203,63,195,139,234,198,185,148,7,201,243,118,21,207,192,230,123,71,113,49,246,236,60,8,74,62,65,95,99,228,241,61,44,236,53,109,229,34,12,163,194,197,183,207,7,49,25,107,39,29,207,155,93,251,149,114,7,134,75,193,236,167,84,154,112,84,175,92,132,144,17,13,138,57,84,35,1,19,235,170,190,21,131,56,173,255,34,117,52,72,243,196,173,184,192,231,40,83,16,74,41,109,5,206,197,73,114,106,193,58,2,148,46,63,93,190,54,189,205,70,239,33,37,179,211,71,157,101,52,42,30,203,237,204,136,236,103,133,158,66,63,211,220,192,150,36,150,62,237,30,228,5,55,22,142,253,81,112,205,139,189,193,191,27,195,249,127,136,50,31,178,154,65,88,231,212,197,39,221,233,193,119,169,110,129,72,236,221,222,129,66,24,247,243,100,215,235,241,176,192,127,147,48,22,74,58,55,147,36,61,251,151,51,116,107,159,212,52,221,221,178,13,150,171,69,166,209,71,165,201,5,39,246,15,243,148,71,229,34,160,255,213,208,150,123,228,20,114,0,68,133,37,152,58,65,169,13,131,134,127,187,84,7,51,33,20,38,1,92,6,109,23,206,1,221,171,227,75,255,24,116,115,110,154,63,222,233,226,74,199,172,28,214,32,77,177,239,60,212,52,42,156,23,73,126,180,172,38,101,65,34,75,129,112,135,39,171,143,71,252,32,72,214,240,126,245,253,176,33,204,155,187,165,143,62,39,7,169,65,122,216,173,142,196,2,242,131,105,251,179,49,128,170,19,76,117,14,254,97,63,87,160,36,13,107,226,235,49,192,198,93,35,78,58,152,110,58,90,175,223,130,241,192,144,204,49,229,68,97,187,37,202,34,34,26,161,92,142,143,49,3,111,245,203,215,175,4,183,74,101,202,42,225,45,20,112,103,200,0,200,167,217,141,244,13,31,82,76,26,152,204,161,155,167,3,236,149,141,174,211,153,68,97,112,6,234,104,24,74,8,54,255,170,20,177,168,193,219,112,33,132,68,66,204,90,162,247,248,64,123,144,209,46,9,100,202,178,205,159,148,185,210,193,199,92,165,198,32,96,87,70,66,215,19,174,61,51,214,97,76,137,223,101,190,175,172,48,188,61,106,40,29,217,230,190,86,207,24,233,38,97,211,121,102,212,228,193,51,231,172,134,0,68,77,105,93,73,247,161,63,60,1,1,130,124,60,145,24,130,224,106,20,169,187,191,102,22,133,169,198,65,246,88,120,193,116,198,109,171,102,128,179,155,92,139,139,110,20,3,1,140,188,121,133,16,130,194,227,235,140,131,97,232,48,31,230,207,36,183,22,82,236,145,148,154,159,147,217,84,116,34,128,83,243,15,201,18,70,162,141,14,163,94,165,252,242,126,211,220,182,54,227,131,105,15,123,16,216,34,29,109,1,156,178,225,109,109,218,102,90,198,11,101,166,78,81,232,137,55,3,68,233,42,54,132,236,227,164,57,216,28,244,40,37,67,71,42,249,58,164,33,21,121,95,200,208,153,52,99,194,188,148,107,82,255,196,1,62,252,77,182,88,127,38,255,199,142,212,78,152,36,186,145,213,83,114,212,90,18,60,189,205,56,213,42,20,58,11,189,157,205,143,225,6,14,30,181,168,13,131,17,14,224,235,221,234,91,67,207,167,54,143,208,115,60,73,223,119,209,79,215,103,86,178,57,13,56,209,22,200,174,202,139,205,151,84,21,224,92,153,118,200,110,190,147,96,185,22,15,219,31,184,0,116,91,156,24,173,151,226,181,82,179,88,189,178,113,35,7,149,160,202,50,182,14,128,183,12,217,163,32,239,87,145,74,55,159,207,188,249,66,11,200,96,228,171,224,201,146,47,237,25,62,113,229,129,132,21,1,3,12,108,190,181,158,108,34,194,27,69,155,22,68,152,197,180,28,94,62,26,233,191,230,236,189,115,134,151,192,10,18,243,49,120,91,82,159,186,41,167,38,203,138,96,94,35,27,115,116,29,65,141,175,70,85,114,132,174,25,15,152,133,66,132,150,127,72,16,33,239,232,41,71,240,49,113,30,195,145,173,145,104,214,194,42,21,110,248,51,3,46,45,164,91,237,153,139,164,126,172,132,139,243,0,55,212,94,97,73,9,164,15,97,218,220,5,46,223,192,90,210,75,205,168,162,184,40,253,219,128,195,46,176,119,222,93,68,151,203,157,85,65,133,64,49,204,27,96,10,246,122,104,111,169,1,33,234,15,201,234,106,221,150,133,237,188,119,243,73,97,62,122,118,50,152,244,16,172,96,254,145,28,181,246,168,18,39,195,11,220,87,221,147,206,194,245,59,255,191,189,77,130,127,249,137,208,130,127,90,33,114,246,95,7,238,217,136,120,255,3,228,42,11,21,58,75,164,209,224,148,53,173,124,26,15,8,94,160,140,110,203,108,212,103,171,95,209,168,20,243,2,234,161,137,3,143,124,192,8,223,94,37,56,183,148,80,48,187,190,220,23,26,52,197,222,186,152,52,13,71,175,158,207,67,107,116,255,21,162,117,88,137,154,10,1,42,28,61,247,220,71,127,197,72,42,66,109,44,248,14,187,45,175,243,94,95,243,36,168,2,181,148,231,49,16,67,144,150,206,159,84,150,92,254,50,102,196,71,120,235,100,189,225,165,53,210,148,246,114,53,54,191,218,214,34,0,91,85,178,235,167,123,166,12,126,137,159,228,194,37,78,137,200,95,250,3,164,159,113,14,183,189,195,205,216,187,121,32,147,49,124,244,122,221,36,142,6,198,35,212,189,74,83,178,244,124,35,115,70,100,73,34,93,224,149,134,15,162,183,207,4,229,125,68,207,79,207,174,82,132,156,123,240,231,194,79,208,77,181,182,232,70,95,0,134,169,53,196,147,102,207,59,160,143,14,160,59,220,189,88,242,169,139,2,95,112,108,59,252,44,244,90,236,246,223,255,254,185,221,216,19,35,221,93,16,67,121,12,9,37,10,168,100,133,94,64,185,155,180,17,164,8,31,74,74,74,0,115,176,56,129,227,166,22,125,64,230,27,230,125,203,196,215,48,6,171,192,25,23,58,139,174,191,25,33,21,204,137,127,12,17,214,212,170,117,181,50,246,81,11,6,238,153,254,82,83,149,74,84,17,71,145,245,193,129,33,104,132,9,49,26,231,99,134,51,18,228,101,136,202,107,186,175,177,5,248,190,0,80,128,159,89,74,101,216,208,3,74,26,57,8,176,38,114,33,3,58,40,175,193,248,118,130,86,95,101,127,18,236,65,77,104,11,124,235,191,210,12,154,95,105,188,135,32,190,178,168,223,240,78,224,118,56,132,16,196,67,219,243,252,99,32,42,179,34,216,216,58,104,49,192,135,71,200,109,37,211,142,67,161,55,148,152,77,179,243,228,232,247,12,148,125,99,137,36,235,9,163,127,33,243,129];
var b = [];
if (b.length !== a.length) {
throw {message: "Test failed! b.length !== a.length"};
}
b[0].test = 'hi';
if (a[0].test === 'hi') {
// throw {message: "Not a deep clone"};
}
for (var i = 1, l = a.length; i < l; i++) {
if (b[i] !== a[i]) {
throw {message: "Test failed! b array is " + b};
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
slice |
| ready |
concat |
| ready |
for-unshift |
| ready |
for-push |
| ready |
for-index |
| ready |
while loop |
| ready |
slice(0) |
| ready |
a.concat() |
| ready |
Array |
| ready |
for index with size |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.