Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
big.js vs Fraction.js vs number-precision
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Native
99127320.0 Ops/sec
Native + toFixed
16131546.0 Ops/sec
Big.js
3591213.8 Ops/sec
Fraction.js
1802781.9 Ops/sec
number-precision
749636.1 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/big.js@6.2.2/big.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/fraction.js@5.2.1/dist/fraction.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/number-precision@1.6.0/build/index.iife.min.js"></script>
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
Native
var a = 0.1; var b = 0.2; ((a + b) * b).toString();
Native + toFixed
var a = 0.1; var b = 0.2; ((a + b) * b).toFixed(9);
Big.js
var a = new Big("0.1"); var b = new Big("0.2"); a.plus(b).mul(b).toString();
Fraction.js
var a = new Fraction("0.1"); var b = new Fraction("0.2"); a.add(b).mul(b).toString();
number-precision
var a = 0.1; var b = 0.2; NP.times(NP.plus(a, b), b).toString()