Script Preparation code:
x
 
var bigInt32 = 2n ** 24n;
var bigInt64 = 2n ** 40n;
var bigInt128 = 2n ** 80n;
var bigIntNum = 2n;
var int32 = 2 ** 10;
var int64 = 2 ** 40;
var float = Math.fround(2 ** 20);
var double = 2 ** 80;
var intNum = 2;
const imul = Math.imul
const fround = Math.fround
Tests:
  • BigInt (32)

     
    let a = bigInt32;
    let b = bigIntNum;
    let c_sub, c_mod, c_mul, c_add;
    c_sub = a - b;
    c_mod = a % b;
    c_mul = a * b;
    c_add = a + b;
  • BigInt (64)

     
    let a = bigInt64;
    let b = bigIntNum;
    let c_sub, c_mod, c_mul, c_add;
    c_sub = a - b;
    c_mod = a % b;
    c_mul = a * b;
    c_add = a + b;
  • BigInt (128)

     
    let a = bigInt128;
    let b = bigIntNum;
    let c_sub, c_mod, c_mul, c_add;
    c_sub = a - b;
    c_mod = a % b;
    c_mul = a * b;
    c_add = a + b;
  • Number (Int32)

     
    let a = int32;
    let b = intNum;
    let c_sub, c_mod, c_mul, c_add;
    c_sub = a - b;
    c_mod = a % b;
    c_mul = a * b;
    c_add = a + b;
  • Number (Int32 asm.js)

     
    "use asm";
    let a = int32 | 0;
    let b = intNum | 0;
    let c_sub, c_mod, c_mul, c_add;
    c_sub = (a - b) | 0;
    c_mod = (a % b) | 0;
    c_mul = imul(a, b);
    c_add = (a + b) | 0;
  • Number (maybe Int64)

     
    let a = int64;
    let b = intNum;
    let c_sub, c_mod, c_mul, c_add;
    c_sub = a - b;
    c_mod = a % b;
    c_mul = a * b;
    c_add = a + b;
  • Number (Float asm.js)

     
    "use asm";
    let a = float;
    let b = fround(intNum);
    let c_sub, c_mod, c_mul, c_add;
    c_sub = fround(a - b);
    c_mod = fround(a % b);
    c_mul = fround(a * b);
    c_add = fround(a + b);
  • Number (Double)

     
    let a = double;
    let b = intNum;
    let c_sub, c_mod, c_mul, c_add;
    c_sub = a - b;
    c_mod = a % b;
    c_mul = a * b;
    c_add = a + b;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    BigInt (32)
    BigInt (64)
    BigInt (128)
    Number (Int32)
    Number (Int32 asm.js)
    Number (maybe Int64)
    Number (Float asm.js)
    Number (Double)

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 16 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Chrome 133 on Windows
View result in a separate tab
Test name Executions per second
BigInt (32) 169096288.0 Ops/sec
BigInt (64) 177226400.0 Ops/sec
BigInt (128) 183639712.0 Ops/sec
Number (Int32) 185756720.0 Ops/sec
Number (Int32 asm.js) 172968016.0 Ops/sec
Number (maybe Int64) 181406160.0 Ops/sec
Number (Float asm.js) 193061312.0 Ops/sec
Number (Double) 181440800.0 Ops/sec