ES6 Class vs Function Prototype vs Object Literal vs Basic function vs Basic functions with object destructuringFastest: Function Prototype (2.1x faster)
2,535,138 ops/sec
2,141,070 ops/sec
1,231,976 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 | |
| Basic function | |
| Basic functions with object destructuring |
| Test name | Executions per second |
|---|---|
| ✓ Basic function | 65,396,164 Ops/sec |
| Basic functions with object destructuring | 63,556,236 Ops/sec |
| Function Prototype | 4,096,838 Ops/sec |
| ES6 Class | 3,524,369 Ops/sec |
| Object Literal | 2,365,983 Ops/sec |