Premature return (v3)

Revision 3 of this benchmark created on


Description

Do premature returns hurt performance?

Preparation HTML

Sucka!
<script>
  function noreturn(a) {
    if (a > .5) {
      a += 1;
    }
  }
  var a = .25, b = .75;
  function premature_returnulation(a) {
    if (a <= .5) {
      return;
    }
    a += 1;
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Premature returns
premature_returnulation(a);
premature_returnulation(b);
ready
No return
noreturn(a);
noreturn(b);
ready

Revisions

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