Number conversion comparison

Benchmark created on


Setup

const n = ['5e-7','2e21','23495673892457','1.239847894357','0.0000000000000008','100000000000000000000000000000000000000',
'-3489572389457928347598237459872359872',
...Array.from(Array(10_000), Math.random),
...Array.from(Array(10_000), () => Math.random().toString())
]

Test runner

Ready to run.

Testing in
TestOps/sec
parseInt
n.forEach(parseInt)
ready
Number
n.forEach(Number)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.