Script Preparation code:
AخA
 
var obj = {};
var arr = ['a', 'b', 'c', 'd'];
Tests:
  • write without reading

     
    for (var i = 0; i < 10000; i++) {
      obj[arr[i % 4]] = true;
    }
  • check first before writing

     
    var key;
    for (var i = 0; i < 10000; i++) {
      key = arr[i % 4];
      if (!obj[key]) {
        obj[key] = true;
      }
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    write without reading
    check first before writing

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36
Chrome 53 on Mac OS X 10.11.6
View result in a separate tab
Test name Executions per second
write without reading 530.6 Ops/sec
check first before writing 507.6 Ops/sec