Script Preparation code:
AخA
 
c = new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255])
Tests:
  • Uint8Array

     
    let stream = new Uint8Array()
    let a = 1000
    while (a --> 0) {
        const buf = new Uint8Array(stream.length + c.length);
        buf.set(stream, 0);
        buf.set(c, stream.length);
        stream = buf;
    }
  • Array

     
    let stream = []
    let a = 1000
    const push = Array.prototype.push;
    while (a --> 0) {
        push.apply(stream, c)
        new Uint8Array(stream)
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Uint8Array
    Array

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15
Safari 18 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Uint8Array 1445.3 Ops/sec
Array 803.9 Ops/sec