Direct Execution vs. eval(): Up to 100x Slower

Benchmarking reveals that a simple expression like `eval('1 + 2')` can be approximately 100 times slower than directly executing `1 + 2`, with the significant overhead attributed to the parsing and compilation steps `eval()` performs at runtime.

Sources

Open the full topic