TypedArray to hi/lo (v2)

Revision 2 of this 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
hi/lo read only
g += HEAPU32[0];
g += HEAPU32[1];
ready

Revisions

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