Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Access to Proxy vs Object vs Signal 2.1ffkikyy
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6.1 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
object define properties
533.0M/s
Signal access
493.4M/s
proxyReflect access
157.8M/s
proxy get
129.6M/s
View exact numbers
Test name
Executions per second
✓
object define properties
533,041,280 Ops/sec
Signal access
493,379,360 Ops/sec
proxyReflect access
157,767,392 Ops/sec
proxy get
129,594,960 Ops/sec
Script Preparation code:
class Signal { constructor(state) { this.value = state; } get() { return this.value; } set(newValue) { if (newValue !== this.value) { this.value = newValue; } } } function createSignal(value) { const v = new Signal(value); return [v.get.bind(v), v.set.bind(v)]; } var [sigData, setData] = createSignal({ value: 'data' }); var mObject = { _value: 'data' }; Object.defineProperty(mObject, 'value', { set: function(nv) { this._value = nv; }, get: function() { return this._value; } }); var proxyReflect = new Proxy({ value: 'data' }, { get(target, prop, receiver) { return Reflect.get(target, prop, receiver) } }) var proxyGet = new Proxy({ value: 'data' }, { get(target, prop, receiver) { return target.value } })
Tests:
proxyReflect access
proxyReflect.value
Signal access
sigData().value
object define properties
mObject.value
proxy get
proxyGet.value