stirng to int (v2)

Revision 2 of this benchmark created 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
shift
i = s >> 0
ready

Revisions

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