Script Preparation code:
AخA
 
var object = { value: 'foo' };
var proxy = new Proxy(object, {
  get(target, prop) {
    return target[prop];
  },
  set(target, prop, value) {
    target[prop] = value;
  }
});
function getData(prop) {
  return object[prop];
}
function setData(prop, val) {
  object[prop] = val;
}
Tests:
  • Object read/write

     
    const val = object.value;
    object.value = 'bar';
  • Proxy read/write

     
    const val = proxy.value;
    proxy.value = 'bar';
  • get/set function

     
    const val = getData('value');
    setData('value', 'bar');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object read/write
    Proxy read/write
    get/set function

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Chrome 132 on Linux
View result in a separate tab
Test name Executions per second
Object read/write 66050972.0 Ops/sec
Proxy read/write 2075251.1 Ops/sec
get/set function 64830928.0 Ops/sec