eval vs new Function vs regularFastest: new Function (1.7x faster)
4,877,754 ops/sec
4,636,360 ops/sec
2,868,686 ops/sec
Fastest: regular (2.7x faster)
4,197,604 ops/sec
4,180,162 ops/sec
1,555,927 ops/sec
Fastest: new Function (2.6x faster)
2,910,494 ops/sec
2,176,495 ops/sec
1,130,242 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 | |
| regular |
| Test name | Executions per second |
|---|---|
| ✓ regular | 4,197,604 Ops/sec |
| new Function | 4,180,162 Ops/sec |
| eval | 1,452,304 Ops/sec |