TypedArray to hi/lo

Benchmark created on


Setup

var HEAPU32 = new Uint32Array(2);
var HEAPU64 = new BigUint64Array(1);

var g = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
To hi/lo via Uint32Array
var arr = [HEAPU32[0], HEAPU32[1]];
var lo = arr[0];
var hi = arr[1];
g += lo;
g += hi;
ready
To hi/lo via BigUint64Array
var val = HEAPU64[0];
var lo = Number(BigInt.asIntN(32, val));
var hi = Number(BigInt.asIntN(32, val >> BigInt(32)));
g += lo;
g += hi;
ready

Revisions

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