Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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:
one year ago
Benchmark engine:
Benchmark.js
this
119K/s
that
117K/s
View exact numbers
Test name
Executions per second
✓
this
118,945 Ops/sec
that
117,272 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();