Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0
Firefox 136
Linux
Desktop
one month ago
Test name Executions per second
BigInt 160787.7 Ops/sec
Number 479388.8 Ops/sec
Script Preparation code:
AخA
 
var bigInt1 = 1000000n
var bigInt2 = 10n
var number1 = 1000000
var number2 = 10
Tests:
  • BigInt

     
    a = bigInt1;
    b = bigInt2;
    for(let i = 0; i < 1000; ++i) {
      c = a << b;
      c = a | b;
      c = a ^ b;
    }
  • Number

     
    a = number1
    b = number2
    for(let i = 0; i < 1000; ++i) {
      c = a << b;
      c = a | b;
      c = a ^ b;
    }