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
Test name
Executions per second
access existing value
278953312.0 Ops/sec
access default value
136031408.0 Ops/sec
access static value
279294240.0 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();