Number() vs parseInt() vs plus (v11)

Revision 11 of this benchmark created on


Preparation HTML

<script>
  var i = '10000';
  i += 'b';
  i = i.slice(0, i.length - 1);
  assert(i === '10000');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Number Constructor
Number(i)
ready
parseInt
parseInt(i)
ready
Plus operator
+i
ready

Revisions

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