merge-array implementations
JavaScript performance comparison
Preparation code
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script>
<script>
Benchmark.prototype.setup = function() {
var arr1 = Array.from(Array(50000), (x,i) => i + 1)
var arr2 = Array.from(Array(50000), (x,i) => i - 1)
var arr1Length = arr1.length;
var arr2Length = arr2.length;
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Test | Ops/sec | |
---|---|---|
push (naive 2)
|
|
pending… |
_.concat
|
|
pending… |
spread (native)
|
|
pending… |
push (naive 1)
|
|
pending… |
concat (naive 2)
|
|
pending… |
push (naive 3)
|
|
pending… |
concat
|
|
pending… |
push
|
|
pending… |
concat (naive 1)
|
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit
to the URL.
- Revision 1: published shiling
- Revision 2: published
- Revision 3: published
- Revision 4: published Oliver Pulges
- Revision 5: published Levent Arman Özak
- Revision 6: published Andrii Malytskyi
- Revision 7: published Andrii Malytskyi
- Revision 8: published Andrii Malytskyi
- Revision 9: published Andrii Malytskyi
- Revision 10: published Allan Marques Baptista
- Revision 11: published Allan Marques Baptista
- Revision 12: published Alex Prozorov
- Revision 13: published Chris Nordhougen
- Revision 14: published Chris Nordhougen
- Revision 15: published Chris Nordhougen
- Revision 17: published Gerardo Lima
- Revision 18: published Gerardo Lima
- Revision 19: published Gerardo Lima
- Revision 20: published Gerardo Lima
- Revision 21: published Gerardo Lima
- Revision 22: published Gerardo Lima
- Revision 23: published Gerardo Lima
- Revision 24: published Gerardo Lima
- Revision 25: published Gerardo Lima
- Revision 26: published Gerardo Lima
- Revision 27: published ChenX
- Revision 28: published
- Revision 29: published
- Revision 30: published
- Revision 31: published
- Revision 32: published Dennis Cheung
- Revision 33: published Dennis Cheung
- Revision 34: published Dennis Cheung
- Revision 35: published Dennis Cheung
- Revision 36: published Dennis Cheung
- Revision 37: published Dennis Cheung
- Revision 38: published Alex Robertson
- Revision 39: published Alex Robertson
- Revision 40: published Alex Robertson
- Revision 41: published Oleg Gomozov
- Revision 42: published Oleg Gomozov
- Revision 43: published Oleg Gomozov
- Revision 44: published Oleg Gomozov
- Revision 49: published Scott Newcomer
- Revision 50: published Scott Newcomer
- Revision 51: published Scott Newcomer
- Revision 52: published Scott Newcomer
- Revision 53: published
- Revision 54: published spread push
- Revision 55: published Oleksandr Popov
- Revision 56: published Oleksandr Popov
0 Comments