Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
cached Intl.NumberFormat vs new Intl.NumberFormat vs toLocaleString currency loop
(version: 0)
Comparing performance of:
cached Intl.NumberFormat vs new Intl.NumberFormat vs toLocaleString
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
cached Intl.NumberFormat
window.a = window.a || new Intl.NumberFormat('en-US', { style: 'decimal', maximumFractionDigits: 2, minimumFractionDigits: 2 }); for (let i = 10000; i< 10100; i++) { window.a.format(i) }
new Intl.NumberFormat
for (let i = 10000; i< 10100; i++) { new Intl.NumberFormat('en-US', { style: 'decimal', maximumFractionDigits: 2, minimumFractionDigits: 2 }).format(i); }
toLocaleString
for (let i = 10000; i< 10100; i++) { i.toLocaleString('en-US', { style: 'decimal', maximumFractionDigits: 2, minimumFractionDigits: 2 }) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
cached Intl.NumberFormat
new Intl.NumberFormat
toLocaleString
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 days ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:150.0) Gecko/20100101 Firefox/150.0
Browser/OS:
Firefox 150 on Mac OS X 10.15
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
cached Intl.NumberFormat
35514.9 Ops/sec
new Intl.NumberFormat
258.1 Ops/sec
toLocaleString
131.1 Ops/sec
Related benchmarks:
Number.toLocaleString vs Intl.NumberFormat3
Number.toLocaleString vs Intl.NumberFormat4
Number.toLocaleString vs Intl.NumberFormat5
cached Intl.NumberFormat vs new Intl.NumberFormat vs toLocaleString currency
cached Intl.NumberFormat vs new Intl.NumberFormat vs Number toLocaleString currency
Intl.NumberFormat vs toLocalString vs Custom Format vs Pre-created Intl formatter
Number.toLocaleString vs Intl.NumberFormat memory pressure
new Intl.NumberFormat vs cached instances
Memoized Intl.NumberFormat vs fresh instances
Comments
Confirm delete:
Do you really want to delete benchmark?