Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Access to Proxy vs Object vs Signal 2.3
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 142
Operating system:
Android
Device Platform:
Mobile
Date tested:
6 months ago
Test name
Executions per second
Proxy access
20686800.0 Ops/sec
Signal access
53692060.0 Ops/sec
object define properties
50913084.0 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; } }); object = { value: 'data' }; proxy = new Proxy(object, {}) proxyWithHandler = new Proxy(object, { get(target, prop, receiver) { return Reflect.get(target, prop, receiver) } })
Tests:
Proxy access
proxy.value
Signal access
sigData().value
object define properties
mObject.value