best of string to number conversion (v30)

Revision 30 of this benchmark created by optionally on


Setup

var x = "12345"

Test runner

Ready to run.

Testing in
TestOps/sec
Number()
Number(x)
ready
parsetInt()
parseInt(x, 10)
ready
parseFloat()
parseFloat(x)
ready
unary
+x
ready
~~ (integer output only)
~~x
ready
| 0 (truncating)
x | 0
ready

Revisions

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