Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
ES6 Class vs Prototype vs Object Literal 4
Test the speed and memory usage using 3 different techniques for constructing class objects.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Browser:
Firefox 128
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
ES6 Class
461513.2 Ops/sec
Function Prototype
416151.8 Ops/sec
Object Literal
1413407744.0 Ops/sec
Tests:
ES6 Class
class Point { constructor(x, y){ this.x = x; this.y = y; } } var p1 = new Point(10, 10); var p2 = new Point(10, -10);
Function Prototype
function Point(x, y){ this.x = x; this.y = y; } var p1 = new Point(10, 10); var p2 = new Point(10, -10);
Object Literal
function Point(x, y){ return { x, y } } var p1 = Point(10, 10); var p2 = Point(10, -10);