Parsing integer string variations

Benchmark created on


Setup

const str = "12345"

Test runner

Ready to run.

Testing in
TestOps/sec
Number constructor
Number(str)
ready
parseInt
parseInt(str)
ready
parseFloat
parseFloat(str)
ready
bitwise OR
str | 0
ready
bitwise NOT
~~str
ready
bitwise left shift
str << 0
ready
bitwise right shift
str >> 0
ready
Plus conversion
+str
ready

Revisions

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