title: Object descriptor getter/setter performance in recent Chrome/V8 versions
body: <p>Given</p>
  
  <pre><code>var obj = {};
  
  var _a = 1;
  
  obj._a = 1;
  
  obj.aGetter = function() {
    return _a;
  }
  
  obj.aSetter = function(val) {
    _a = val;
  }
  
  Object.defineProperty(obj, 'a', {
    enumerable: true,
    get: function () {
      return _a;  
    },
    set: function(val) {
      _a = val;
    }     
  });
  </code></pre>
  
  <p>using getter/setter functions</p>
  
  <pre><code>obj.aSetter(2);
  obj.aGetter();
  </code></pre>
  
  <p>will have some decrease in Chrome/V8 performance (~3x) when compared to direct property access:</p>
  
  <pre><code>obj._a = 2;
  obj._a;
  </code></pre>
  
  <p>This is be understandable. And using descriptor getter/setter</p>
  
  <pre><code>obj.a = 2;
  obj.a;
  </code></pre>
  
  <p>will cause <strong>~30x decrease in Chrome</strong> (41 to latest) performance - almost as slow as <code>Proxy</code>. While Firefox and older Chrome versions use descriptor getter/setter with no significant performance penalty.</p>
  
  <p>What is the exact problem with descriptor getter/setter performance in recent Chrome/V8 versions? Is it a known issue that can be monitored?</p>
  
  <p><em>The measurements were done with Benchmark.js (jsPerf engine). I'm unable to provide a link to jsPerf test to visualize the difference because jsPerf has been seriously screwed up with its anti-DDoS measures, but I'm sure there are existing ones that can prove a point.</em></p>