Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Access to Object vs Signal 2.1
(version: 0)
Comparing performance of:
Signal access vs object define properties
Created:
one year ago
by:
Guest
Jump to the latest result
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' }); // Object var mObject = {_value:'data'}; Object.defineProperty(mObject, 'value', { set: function (nv) { this._value = nv; }, get: function() { return this._value; } });
Tests:
Signal access
sigData().value
object define properties
mObject.value
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Signal access
object define properties
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Browser/OS:
Chrome 125 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Signal access
20645500.0 Ops/sec
object define properties
19784874.0 Ops/sec
Related benchmarks:
Access to Proxy vs Object vs Signal 2.1
Access to Proxy vs Object vs Signal 2.1ffkikyydgdfg
Access to Object vs Signal 2.2
Access to Proxy vs Object vs Signal 2.3
Comments
Confirm delete:
Do you really want to delete benchmark?