ES6 Class vs Function Prototype vs Object LiteralFastest: Object Literal (3.8x faster)
1,687,215 ops/sec
570,483 ops/sec
441,062 ops/sec
Fastest: Object Literal (1.7x faster)
949,503 ops/sec
571,880 ops/sec
549,336 ops/sec
Fastest: Function Prototype (1.9x faster)
4,811,319 ops/sec
4,615,720 ops/sec
2,576,988 ops/sec
Fastest: Object Literal (3.9x faster)
586,020 ops/sec
178,939 ops/sec
151,703 ops/sec
Fastest: Function Prototype (2.0x faster)
5,436,790 ops/sec
5,132,918 ops/sec
2,757,668 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| ES6 Class | |
| Function Prototype | |
| Object Literal |
| Test name | Executions per second |
|---|---|
| ✓ Function Prototype | 2,899,462 Ops/sec |
| ES6 Class | 2,454,884 Ops/sec |
| Object Literal | 1,121,592 Ops/sec |