Python Forum
Understand order of magnitude performance gap between python and C++
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Understand order of magnitude performance gap between python and C++
#2
Compiled languages typically are faster than interpreted or hybrid, depending on factors such as the efficiency of the compiler, bytecode interpreter, etc. As one learns Python, you find that doing things in the "pythonic" way can be quite fast - list comprehensions, Pandas operations etc.

You started with a program optimized for C++. Translation of that to any other language is almost guaranteed to be less efficient.

So, first that I would do is take the Python version, put it up on Google Colab, and run it using GPU or TPU hardware acceleration and see if that perks things up. In once online course that ran faster than using IBM's Watson. That, while doing a rewrite in Python that starts from scratch and uses pythonic code.
Reply


Messages In This Thread
RE: Understand order of magnitude performance gap between python and C++ - by jefsummers - Mar-15-2021, 11:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Understand what it means that everything in Python is an object... bytecrunch 8 5,273 Mar-19-2021, 04:47 PM
Last Post: nilamo
  Trying to understand the python code spalisetty 2 2,656 Mar-16-2020, 08:11 AM
Last Post: javiertzr01
  I do not understand why my python looks different from tutorials. noodlespinbot 2 6,837 Oct-12-2019, 09:56 PM
Last Post: noodlespinbot
  performance kerzol81 1 2,382 Oct-07-2019, 10:19 AM
Last Post: buran
  I dont understand bytes in python. blackknite 3 6,736 Oct-02-2019, 07:39 PM
Last Post: Gribouillis
  Python performance rvkstudent 4 3,902 Apr-25-2019, 09:29 AM
Last Post: rvkstudent
  Python Turtle and order of implementation query Parsleigh 2 3,439 Mar-04-2019, 02:43 PM
Last Post: Parsleigh
  Trying to understand how import works in python patrick99e99 3 4,835 Jun-12-2018, 04:48 AM
Last Post: patrick99e99
  Python 3.6 dict key iteration order insearchofanswers87 7 6,754 May-22-2018, 05:33 PM
Last Post: snippsat
  Harmonics and their Magnitude values khanna 4 6,027 May-03-2018, 10:53 AM
Last Post: khanna

Forum Jump:

User Panel Messages

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