I have a python application running on Raspberry Pi.

Python version: 3.7.3.

The application does heavy run-time calculations and therefore runs very slow on the raspberry pi. The application uses several python packages which I have installed using pip3.

How can I make this python application run faster?

I have searched and found that when python application runs it uses an interpreter at run time and this slows it down a little. How I can somehow 'compile' the python application in some way and run the application natively (avoiding run-time interpreter)? This way I believe it will run fast.

Any other strategy (to run python faster) is also appreciated.

Kindly check my few comments below.

  • I have tagged both R pi 3 and 2 because because I am seeking answers for both boards. – NeedSomeLuck Mar 26 at 3:26
  • Python is as interpreted language! – Milliways Mar 26 at 3:32
  • 1
    @Milliways. Yes, primarily. But the application CAN be converted into a native application like C/C++ so that when it (compiled python) is running it avoids a run-time interpreter. I am pretty sure about this. – NeedSomeLuck Mar 26 at 3:35
  • 2
    Try this: askubuntu.com/questions/153823/…. – tlfong01 Mar 26 at 4:02
  • Maybe the application could be more effective, maybe the algorithms can be improved. Perhaps this is a question for the Code review section. – Anonymous Mar 26 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.