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 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Function
23K/s
Class
10K/s
View exact numbers
Test name
Executions per second
✓
Function
23,457 Ops/sec
Class
10,000 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(); }