3 ms·
I know this is supposed to be about python optimization. However, the post switches over to C at nearly the beginning of the process. Hence it really is about
by hpcjoe 6y ago
I know this is supposed to be about python optimization. However, the post switches over to C at nearly the beginning of the process. Hence it really is about how to optimize python applications, by rewriting them in C (or other fast languages).
Which IMO, isn't about optimizing Python, apart from tangential API/library usage.
I've been under the impression that I'll get the best performance out of a language when I write code that leverages the best idiomatic features, and natural aspects of the language. If I have to resort to another language along the way to get needed performance, I guess the question is, isn't this a strong signal that I should be looking at different languages ... specifically fast ones?
Most of the fast elements of python are interfaces to C/Fortran code (numpy, pandas, ...). What is the rationale for using a slow language as glue versus using a faster language for processing?
- shepardrtc 6y ago> What is the rationale for using a slow language as glue versus using a faster language for processing? It's much quicker and easier to put together a Python program than a C/C++ program. The number of libraries out there for Python is incredible.
- hpcjoe 6y agoHonestly, this is subjective. I generally agree that some languages are well designed for fast prototyping, but not really great for computationally intensive production. I see Python in this role. Note that when the original author wished to move this to a faster execution capability, they had to change languages. So they get the disadvantage of having to do the port anyway. How does this save time?