Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
decimal.js vs. Fraction.js
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0
Browser:
Chrome 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Native
43.3M/s
Native + toFixed
5.1M/s
Fraction.js
933K/s
decimal.js
569K/s
View exact numbers
Test name
Executions per second
✓
Native
43,347,636 Ops/sec
Native + toFixed
5,068,781 Ops/sec
Fraction.js
933,433 Ops/sec
decimal.js
568,828 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/decimal.js@10.2.0/decimal.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/fraction.js@4.0.12/fraction.min.js"></script>
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);
decimal.js
var a = new Decimal("0.1"); var b = new Decimal("0.2"); a.plus(b).times(b).toString();
Fraction.js
var a = new Fraction("0.1"); var b = new Fraction("0.2"); a.add(b).mul(b).toString();