pointless-map

JavaScript performance comparison

Test case created by ZackBurtAWS

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  let pointsArray_ = [];
  for(let i = 0; i<99999; i++) {
     pointsArray_.push(Math.random());
  }
  const pointsArray = new Float32Array(pointsArray_);

};
</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
For there is no point to this
const newPointsArray = [];
for(let i = 0; i < pointsArray.length; i++) {
   newPointsArray.push(pointsArray[i]);
}
pending…
Pointless map
const newPointsArray = pointsArray.map(point => point);
pending…

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

0 Comments