eval vs new FunctionFastest: new Function (4.6x faster)
27,965,198 ops/sec
6,131,308 ops/sec
Fastest: new Function (421.2x faster)
1,395,258,112 ops/sec
3,312,896 ops/sec
Fastest: new Function (4.1x faster)
7,941,038 ops/sec
1,937,478 ops/sec
Fastest: new Function (2.7x faster)
30,236,308 ops/sec
11,125,144 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 | 87,123,456 Ops/sec |
| eval | 5,308,911 Ops/sec |