Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Chrome 125
Mac OS X 10.15.7
Desktop
6 months ago
Test name Executions per second
toLocaleString 72843.4 Ops/sec
Intl.NumberFormat 71551.3 Ops/sec
string split & reduce 3170191.8 Ops/sec
toFixed 7645841.5 Ops/sec
bignumber 1345675.4 Ops/sec
numberWithCommas 972150.3 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • toLocaleString

  • Intl.NumberFormat

  • string split & reduce

  • toFixed

  • bignumber

  • numberWithCommas