parse vs plus (v3)

Revision 3 of this benchmark created by Bob Fornal on


Description

I moved the variable declaration into "Preparation code", since it is not actually being changed by the tests. This should provide "truer" results.

Preparation HTML

<script>
var x = "5555";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
parse
var y = parseInt(x, 10);
ready
plus
var y = +x;
ready

Revisions

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

  • Revision 2: published by sdasdas on
  • Revision 3: published by Bob Fornal on