Prefix or Postfix increment? (v8)

Revision 8 of this benchmark created by gfx on


Description

So with recent JS runtimes, does using the prefix increment/decrement operators squeeze the usual performance droplet from loop index maintenance?

Preparation HTML

<script>
  var data = new Array(500 * 1000);
  var index = data.length;
  while (index--) data[index] = index;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
++i
for (var index = 0, len = data.length; index < len; ++index) {
 data[index] = 1;
}
 
ready
Suffix
data[data.length-1] = null;
for (var index = 0, len = data.length; index < len; index++) {
 data[index] = 1;
}
 
ready

Revisions

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