Python Forum
Python Program running a lot slower after change to Ubuntu
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Program running a lot slower after change to Ubuntu
#1
Hello,

I have a program that I wrote and used in Windows.
It's using opencv-pythons template matching to find a lot of pictures very quickly.
On Windows it took about 0.5 seconds but after changing to Ubuntu 20.04LTS it takes 1.5 seconds.
I even installed opencv from the source files after trying it with pip but that didn't change much either.
I hope someone knows the reason or if there is anything to improve the performance on Ubuntu.

Thanks in Advance
Reply
#2
There might be a million reasons. Normally Python is faster on Linux than on Windows and the fastest version is said to be the latest.

First: Is it the same Python implementation and version on both systems?

PyPi is also said to be a faster interpretor than the standard one.
Then there are CPython and Nuitka, where Nuitka is said to be the fastest.

For info look at e.g. https://realpython.com/pypy-faster-python/

https://www.javatpoint.com/which-is-the-...-of-python

You also have performance tips on
https://wiki.python.org/moin/PythonSpeed...rmanceTips
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Program running on RPi 3b+ Very Strange Behavior - Out of Bound Index MadMacks 26 3,055 Mar-07-2023, 09:50 PM
Last Post: MadMacks
  Python in Singularity Container on Ubuntu erdemath 0 876 Aug-31-2022, 02:17 PM
Last Post: erdemath
  Python icons in Ubuntu KatManDEW 4 63,965 Aug-12-2022, 08:33 AM
Last Post: rob101
  running a TensorFlow program Led_Zeppelin 0 880 Apr-07-2022, 06:33 PM
Last Post: Led_Zeppelin
  Python 3.8 on Ubuntu 20.04 erdemath 1 1,333 Mar-07-2022, 09:31 PM
Last Post: Larz60+
  Python script in Ubuntu core Nithin_Kumar 1 3,334 May-11-2021, 01:14 AM
Last Post: Skaperen
  Running Python 2.7 program ErnestTBass 2 2,716 Oct-21-2020, 08:06 AM
Last Post: snippsat
  read terminal text from running program AArdvark_UK 2 1,853 Aug-27-2020, 12:43 PM
Last Post: AArdvark_UK
  Modify code from running program ? samuelbachorik 2 2,408 Jun-26-2020, 08:17 PM
Last Post: samuelbachorik
  Python - change variable type during program execution ple 1 2,334 Apr-12-2020, 08:43 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020