performance of parseInt()

Benchmark created by GlitchMr on


Test runner

Ready to run.

Testing in
TestOps/sec
parseInt(x)
parseInt('4')
ready
parseInt(x, 10)
parseInt('4', 10)
ready
+x
+'4'
ready
~~x
~~'4'
ready
parseFloat(x)
parseFloat('4')
ready
Number(x)
Number('4')
ready
new Number(x)
// Please note that new primitives are dangerous
new Number('4')
ready
Math.floor(x)
Math.floor('4')
ready
Math.ceil(x)
Math.ceil('4')
ready
Math.round()
Math.round('4')
ready

Revisions

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