Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Class vs Function
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Browser:
Firefox 133
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Class
5817.4 Ops/sec
Function
14223.0 Ops/sec
Tests:
Class
class A { x = 0; y = 0; }; for(let i = 0; i < 1000; i++) { let a = new A(); }
Function
function A () { this.x = 0; this.y = 0; } for (let i = 1; i < 1000; i++) { let a = new A(); }