Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
this vs that
What is faster? Referencing something with this or with a variable called that, pointing to this?
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Browser:
Firefox 140
Operating system:
Linux
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
this
118944.8 Ops/sec
that
117272.2 Ops/sec
Script Preparation code:
function Monster() { this.x = 100; this.y = 100; console.log("Monster created at " + this.x + " / " + this.y + "!"); } function Monster2() { var that = this; that.x = 100; that.y = 100; console.log("Monster created at " + that.x + " / " + that.y + "!"); }
Tests:
this
new Monster();
that
new Monster2();