Though performance is often cited as a reason people are skeptical of Python (see @grokcode 's recent post and the replies to it ), I haven't run into many performance issues in Python myself. On the other hand, most of the programming I've done in Python hasn't been the kind where milliseconds matter (or if they did matter, it was already optimized by libraries like NumPy and Matplotlib).
The one performance issue I had to deal with wasn't with Python itself, but with having to await the results of many database queries, and therefore needing to have multiple ones running at a time. I spent some time trying to get multiprocessing to work, before realizing that threading was sufficient (as the Python code itself wasn't CPU-bound).
Have you run up against performance issues in Python, or had to use it in a resource-constrained environment? What kind of problems did you have? What did you do to meet your performance needs?
Edit to add: If you've never run up against performance issues in Python after using it a lot, especially if there was some situation where you you thought performance was going to be a problem, I'd like to hear about too.
Top comments (6)
I think it's often a matter of picking the right tool for the job. In web development, it rarely seems like the language is the most important bottleneck.
Of course, it's a factor, but other things take precedence.
In other areas of software, the language's performance winds up playing a bigger role. Don't write an OS in Python!!
Did some financial calculation in real-time. It was taking minutes but with appropriate pre-calculations and a smarter algorithm it went down to 100ms. Yay. Well that's why algorithm complexity matters and also it applies to the whole system and not just your piece of code.
I'm interested in hearing a little more about your journey from A to B.
Can you elaborate on that? What framework/etc. were you using? What did you end up using?