Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Chrome 135
Mac OS X 10.15.7
Desktop
one year ago
Native toFixed(9)
39.2M/s
Native toString()
39.0M/s
big.js toString()
400K/s
bignumber.js toString()
357K/s
big.js toFixed(18)
352K/s
decimal.js toString()
328K/s
bignumber.js toFixed(18)
317K/s
decimal.js toFixed(18)
273K/s
View exact numbers
Test name Executions per second
Native toFixed(9) 39,231,052 Ops/sec
Native toString() 39,037,840 Ops/sec
big.js toString() 399,813 Ops/sec
bignumber.js toString() 357,442 Ops/sec
big.js toFixed(18) 351,575 Ops/sec
decimal.js toString() 328,054 Ops/sec
bignumber.js toFixed(18) 316,740 Ops/sec
decimal.js toFixed(18) 272,548 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: