Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1
Mobile Safari 17
iOS 17.2.1
Mobile
2 years ago
Native toString()
5.5M/s
Native toFixed(9)
5.3M/s
bignumber.js toString()
379K/s
big.js toString()
377K/s
bignumber.js toFixed(18)
371K/s
big.js toFixed(18)
340K/s
decimal.js toString()
268K/s
decimal.js toFixed(18)
248K/s
View exact numbers
Test name Executions per second
Native toString() 5,532,476 Ops/sec
Native toFixed(9) 5,324,428 Ops/sec
bignumber.js toString() 378,998 Ops/sec
big.js toString() 377,440 Ops/sec
bignumber.js toFixed(18) 370,607 Ops/sec
big.js toFixed(18) 339,654 Ops/sec
decimal.js toString() 267,856 Ops/sec
decimal.js toFixed(18) 248,396 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests: