string to int

Benchmark created by rmaksim on


Preparation HTML

<script>
  var s = "12", i;
  
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
parseint
i = parseInt(s);
ready
plus
i = +s;
ready
number
i = Number(s);
ready
tilda
i = ~~s;
ready
parseint2
i = parseInt(s);
ready
plus2
i = +s;
ready
number2
i = Number(s);
ready
tilda2
i = ~~s;
ready
or
i = s|0;
ready
up
i = s^0;
ready
shift
i = s>>0;
ready
or2
i = s|0;
ready
up2
i = s^0;
ready
shift2
i = s>>0;
ready

Revisions

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