eval vs new FunctionFastest: new Function (2.0x faster)
4,556,575 ops/sec
2,290,763 ops/sec
Fastest: new Function (3.1x faster)
5,435,708 ops/sec
1,735,342 ops/sec
Fastest: new Function (2.2x faster)
2,522,976 ops/sec
1,167,541 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| eval | |
| new Function |
| Test name | Executions per second |
|---|---|
| ✓ new Function | 6,408,443 Ops/sec |
| eval | 4,607,928 Ops/sec |