Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15
Safari 14
Mac OS X 10.15.7
Desktop
3 years ago
Test name Executions per second
Basic 3492865.5 Ops/sec
Proxy 1897017.1 Ops/sec
Proto 3838049.2 Ops/sec
Script Preparation code:
AخA
 
window.basic = {a : 1, b: 2};
window.proxy = new Proxy({a : 1, b: 2}, {get : (t, p) => t[p]})
window.proto = Object.setPrototypeOf({}, {a : 1, b: 2})
Tests:
  • Basic

     
    let a = basic.a;
    let b = basic.b;
  • Proxy

     
    let a = proxy.a;
    let b = proxy.b;
  • Proto

     
    let a = proto.a;
    let b = proto.b;