Script Preparation code:
x
 
var n = 10000;
var range = 1000000;
var a = [...Array(n)].map(_ => Math.random(range));
var a32 = new Float32Array(a);
var a64 = new Float64Array(a);
Tests:
  • Array

     
    for (let i = 0; i < n; i++) {
      a[i] = a[i] / 2;
    }
  • Float32Array

     
    for (let i = 0; i < n; i++) {
      a32[i] = a32[i] / 2;
    }
  • Float64Array

     
    for (let i = 0; i < n; i++) {
      a64[i] = a64[i] / 2;
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array
    Float32Array
    Float64Array

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
Firefox 132 on Windows
View result in a separate tab
Test name Executions per second
Array 69224.7 Ops/sec
Float32Array 137563.3 Ops/sec
Float64Array 137523.9 Ops/sec