Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Property assignment vs Variable assignment
The significance is function oriented vs object orient approach to building UI
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 12; Mobile; rv:150.0) Gecko/150.0 Firefox/150.0
Browser:
Firefox Mobile 150
Operating system:
Android
Device Platform:
Mobile
Date tested:
one month ago
Test name
Executions per second
Function approach
1167070.6 Ops/sec
Object approach
1216697.1 Ops/sec
Script Preparation code:
function createFunctionBench() { let value = null; return function closure(val) { if (val) { value = val; } return value; }; } class ClassBench { update(val) { if (val) { this.value = val; } return this.value; } } bench = { fn: createFunctionBench(), cls: new ClassBench() };
Tests:
Function approach
bench.fn(performance.now());
Object approach
bench.cls.update(performance.now());