Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Native toString() 514567392.0 Ops/sec
Native toFixed(9) 15527866.0 Ops/sec
bignumber.js toString() 484169.1 Ops/sec
bignumber.js toFixed(18) 466552.5 Ops/sec
big.js toString() 639991.2 Ops/sec
big.js toFixed(18) 575980.4 Ops/sec
decimal.js toString() 550162.6 Ops/sec
decimal.js toFixed(18) 513656.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Native toString()

  • Native toFixed(9)

  • bignumber.js toString()

  • bignumber.js toFixed(18)

  • big.js toString()

  • big.js toFixed(18)

  • decimal.js toString()

  • decimal.js toFixed(18)