Copie... (v5)

Revision 5 of this benchmark created on


Setup

let u = Array.from({length:10000}, (e,i) => new BigInt64Array([BigInt(i)]) );

let n = Array.from({length:10000}, (e,i) => BigInt(i) );

let m = Array.from({length:10000}, (e,i) => { return { isCopied: true, value: new BigInt64Array([BigInt(i)]) } });

let a = Array.from({length:10000}, (e,i) => i )

Test runner

Ready to run.

Testing in
TestOps/sec
Recreation.
let e;

for(let i = 0; i < 10000; ++i)

    e = new BigInt64Array( [ n[i] ] )
ready
Slice
let e;

for(let i = 0; i < 10000; ++i)

    e = u[i].slice()
ready
Number
let e;

for(let i = 0; i < 10000; ++i)
    e = a[i];
ready
Recreation 2
let e;

for(let i = 0; i < 10000; ++i) {

    (e = new BigInt64Array( 1 ), e[0] = n[i], e)
    }
ready
Current ?
let e;

for(let i = 0; i < 10000; ++i) {

    e = {type: "integer", value: n[i]}
    }
ready
New
let e;

for(let i = 0; i < 10000; ++i) {

    e = m[i]
    }
ready

Revisions

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