Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JS: Getter/Setter vs Direct Access Performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
access static value
279.3M/s
access existing value
279.0M/s
access default value
136.0M/s
View exact numbers
Test name
Executions per second
✓
access static value
279,294,240 Ops/sec
access existing value
278,953,312 Ops/sec
access default value
136,031,408 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const existingA = 'truthy-value'; const existingB = undefined; class Env { get a() { return existingA || 'a-default-value'; } get b() { return existingB || 'b-default-value'; } } const env = new Env(); const config = { c: 'c-value', };
Tests:
access existing value
function a() { return env.a; } const aReading = a();
access default value
function b() { return env.b; } const bReading = b();
access static value
function c() { return config.c; } const cReading = c();