performance of parseInt() (v9)

Revision 9 of this benchmark created on


Test runner

Ready to run.

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

Revisions

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