I'm planning to use python to build a couple of programs to be used as services, run from PHP code later on.
In terms of performance, which is faster, to compile the python code into a binary file using cx_freeze or to run the python interpreter each time I run the program?
Deployment environment:
OS: Arch Linux ARM
Hardware: Raspberry Pi [700MHz ARMv6 CPU, 256MB RAM, SD Card filesystem]
Python Interpreter: Python2.7
App calls frequency: High
cx_freeze (and the various competitors for "compiling" Python code to executables) don't actually compile anything. They're just a convenient way of packaging the app in such a way that it can be run directly. In other words, there's no performance difference.
Depending on what you need to do in your Python script, you could consider using Pypy to improve your performance.
Compiled binaries VS interpreted code in python