Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
variable vs property (var vs this.property) - v2
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/150.0.0.0 Safari/537.36
Browser:
Chrome 150
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
12 days ago
variable
3.4M/s
window.variable
2.9M/s
window.property
2.9M/s
this.property
289K/s
this.variable
230K/s
View exact numbers
Test name
Executions per second
✓
variable
3,371,403 Ops/sec
window.variable
2,933,010 Ops/sec
window.property
2,925,564 Ops/sec
this.property
288,962 Ops/sec
this.variable
230,293 Ops/sec
Script Preparation code:
var a=123,b=123,c=123; this.d=this.e=this.f=123;
Tests:
variable
for (let i = 0; i < 100; i++) { a + b + c + i; }
this.property
for (let i = 0; i < 100; i++) { this.d + this.e + this.f + i; }
window.property
for (let i = 0; i < 100; i++) { window.d + window.e + window.f + i; }
this.variable
for (let i = 0; i < 100; i++) { this.a + this.b + this.c + i; }
window.variable
for (let i = 0; i < 100; i++) { window.a + window.b + window.c + i; }