Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16773

Does eval() have performance advantage in Mojo vs. Python?

$
0
0

I would like to use eval() for validation of short function synthesis. The search space may be fairly large, e.g. more than a million different functions. Functions will be synthesized as a string containing their source code and executed with eval().

Will Mojo have a performance advantage vs. Python for this task, or it just calls Python's eval() through the compatibility layer? Is there a different method than string and eval(), which would work for my scenario?


Just to add some context, so concerns about security of calling eval are put to rest. What I'm doing is called Program Synthesis, see: https://en.wikipedia.org/wiki/Program_synthesis. I'm not calling eval on an unknown source code.


Viewing all articles
Browse latest Browse all 16773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>