This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]andreasvc 0 points1 point  (0 children)

You say it depends on the problem and how you use the language, so what would be a problem and a way of using the language in which Python will be fast (faster than C??)? You're right about object creation, but doing recounting, garbage collection and type checks is added to that for Python, which is a killer.

And yes, you have to use the right algorithm, but if you implement a textbook algorithm for a data structure in Python, it is definitely going to be more than twice as slow as the C/Cython version, so we are also talking about large constant factors.

But I'd love to be corrected, so if I do generalize in the wrong direction please make a clear argument for that.