Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
class vs function mk I
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0
Browser:
Firefox 125
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
class
210906.5 Ops/sec
function
20574324.0 Ops/sec
Tests:
class
class Test { constructor(x) { this.x = x; } add() { return (Math.pow(this.x, 10) + Math.exp(this.x) + Math.sin(this.x) - Math.cos(this.x)); } } for (var i = 0; i < 100; i++) { new Test(34235345345342342323423422334423).add(); }
function
function add(x) { return (Math.pow(x, 10) + Math.exp(x) + Math.sin(x) - Math.cos(x)); } for (var i = 0; i < 100; i++) { add(34235345345342342323423422334423); }