3 ms·
Another option is GraalPy (https://www.graalvm.org/python/ https://www.graalvm.org/python/) which is a Python JIT compiler. I've used it to embed an entire Pyth
by crustycoder 2y ago
Another option is GraalPy (https://www.graalvm.org/python/ https://www.graalvm.org/python/) which is a Python JIT compiler. I've used it to embed an entire Python runtime in an application that's written in Scala which I then compiled to a native executable (https://www.graalvm.org/latest/reference-manual/native-image/ https://www.graalvm.org/latest/reference-manual/native-image...) ending up with a zero-dependency single-file application that can execute and interact with arbitrary Python scripts.
As pointless benchmarks seem to be the thing, here's the numbers for different flavours of the one from the article with "10 20 30 40 50" as the args to make it a teeny bit more realistic:
C 27sec
Java 39sec 1.4x C
GraalPy 139sec 5.1x C
PyPy 252sec 9.3x C
CPython 1780sec 66.3x C
Not that this will tell you much about real-world use cases, of course, but hell, it's Friday afternoon...