Script Preparation code:
x
 
var size = 50000;
var buf = new ArrayBuffer(size*8);
var view = new DataView(buf);
var buf2 = new ArrayBuffer(size*4);
var view2 = new DataView(buf2);
var data = new Float64Array(size);
var data2 = new Float32Array(size);
Tests:
  • DataView

     
    for (let i=0; i < size; i++) {
        view.setFloat64(i*8, 992.2258);
    }
    for (let i=0; i < size; i++) {
        const res = view.getFloat64(i*8);
    }
  • Float64Array

     
    for (let i=0; i < size; i++) {
        data[i] =  992.2258;
    }
    for (let i=0; i < size; i++) {
        const res = data[i];
    }
  • Float32Array

     
    for (let i=0; i < size; i++) {
        data[i] =  992.2258;
    }
    for (let i=0; i < size; i++) {
        const res = data[i];
    }
  • DataView 32

     
    for (let i=0; i < size; i++) {
        view2.setFloat32(i*4, 992.2258);
    }
    for (let i=0; i < size; i++) {
        const res = view2.getFloat32(i*4);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    DataView
    Float64Array
    Float32Array
    DataView 32

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Chrome 126 on Windows
View result in a separate tab
Test name Executions per second
DataView 172.5 Ops/sec
Float64Array 174.5 Ops/sec
Float32Array 174.2 Ops/sec
DataView 32 172.7 Ops/sec