HTML Preparation code:
x
 
1
<!--script src="https://raw.githubusercontent.com/iriscouch/bigdecimal.js/v0.6.1/lib/bigdecimal.js"></script-->
2
<script src="https://cdnjs.cloudflare.com/ajax/libs/bignumber.js/9.0.1/bignumber.min.js"></script>
3
<script src="https://cdnjs.cloudflare.com/ajax/libs/big.js/6.0.3/big.min.js"></script>
4
<script src="https://cdnjs.cloudflare.com/ajax/libs/decimal.js/10.2.1/decimal.min.js"></script>
5
<!--script src="https://raw.githubusercontent.com/infusion/Fraction.js/v4.0.12/fraction.min.js"></script-->
6
Tests:
  • native

     
    const a = parseFloat('123.456');
    const b = parseFloat('123.456');
    const d = a > b || a < b;
  • decimal.js

     
    const a = new Decimal('123.456');
    const b = new Decimal('123.456');
    const d = a.greaterThan(b) || a.lessThan(b);
  • big.js

     
    const a = new Big('123.456');
    const b = new Big('123.456');
    const d = a.gt(b) || a.lt(b);
  • bignumber.js

     
    var a = new BigNumber('123.456');
    var b = new BigNumber('123.456');
    const d = a.gt(b) || a.lt(b);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    native
    decimal.js
    big.js
    bignumber.js

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0
Firefox 118 on Windows
View result in a separate tab
Test name Executions per second
native 10257499.0 Ops/sec
decimal.js 1075698.5 Ops/sec
big.js 1544318.5 Ops/sec
bignumber.js 903064.9 Ops/sec