parsing numbers for kewl

Benchmark created on


Preparation HTML

<script>
  var str="12px",
  re=/\D/g
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
parseInt
parseInt(str);
ready
regex + bitwise
+str.replace(re,"");
ready
regex ~~ bitwise
~~str.replace(re,"");
ready

Revisions

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