Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JS BigInt vs Number
Comparing BigInt vs Number arithmetic performance using values safely represented by i64 and f64 respectively
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 141
Operating system:
Android
Device Platform:
Mobile
Date tested:
6 months ago
Test name
Executions per second
Bigint
1299467.1 Ops/sec
Number
1280324.0 Ops/sec
BigInt and textContext
989696.0 Ops/sec
Number with textContext
1071413.2 Ops/sec
HTML Preparation code:
<div id="result">
Script Preparation code:
const result = document.getElementById("result"); const b1 = ((2n ** 63n) - 1n) / 5n; const b2 = 5n; let b3 = 0n; const n1 = Number.MAX_SAFE_INTEGER / 5; const n2 = 5; let n3 = 0;
Tests:
Bigint
b3 = b1 * b2; b3 = b3 - b2; b3 = b3 / b2; b3 = b3 + b2; b3 = b3 % b2;
Number
n3 = n1 * n2; n3 = n3 - n1; n3 = n3 / n2; n3 = n3 + n2; n3 = n3 % n2;
BigInt and textContext
b3 = b1 * b2; b3 = b3 - b2; b3 = b3 / b2; b3 = b3 + b2; b3 = b3 % b2; result.textContent = b3;
Number with textContext
n3 = n1 * n2; n3 = n3 - n1; n3 = n3 / n2; n3 = n3 + n2; n3 = n3 % n2; result.textContent = n3;