Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
ES6 Class vs Prototype vs Object Literal v3
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 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 122
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Object Literal
7.2M/s
ES6 Class
0/s
View exact numbers
Test name
Executions per second
✓
Object Literal
7,231,853 Ops/sec
ES6 Class
0 Ops/sec
Script Preparation code:
class Point1 { constructor(x, y) { this.x = x; this.y = y; } } function Point3(x, y) { return { x, y } }
Tests:
ES6 Class
var p1 = new Point1(10, 10); var p2 = new Point1(10, -10);
Object Literal
var p1 = Point3(10, 10); var p2 = Point3(10, -10);