increase arr

JavaScript performance comparison

Test case created by Eracal

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  let len = 100
  let increaseArr = Array.from({length: len}).map((i, k) => k)

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
arr1
let newArr = new Array(len)
for (let i = 0; i < len; i++) {
  newArr[i] = increaseArr[i]
}
pending…
arr2
let newArr = new Array(len)
for (let i = len - 1; i > 0; i--) {
  newArr[i] = increaseArr[i]
}
pending…
arr3
let newArr = []
for (let i = 0; i < len; i++) {
  newArr[i] = increaseArr[i]
}
pending…
arr4
let newArr = []
for (let i = len - 1; i > 0; i--) {
  newArr[i] = increaseArr[i]
}
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.

0 Comments