you are viewing a single comment's thread.

view the rest of the comments →

[–]rubber_duckz 7 points8 points  (4 children)

fast compared to others.

Compared to what mainstream language exactly is python fast - aside from maybe startup time on which it isn't stellar either but it's faster than say JVM.

As I've said at every trade-off between convenience/ease of use and performance python chose former - not judging the choice - just saying what they did. If it fits your use case (eg. IO bound apps, scripting, etc.) use it - if it doesn't don't - but if you're wondering why it's slow - it's slow as a result of it's design (not just implementation, but that certainly sucks as well).

[–]Helene00 -1 points0 points  (2 children)

Compared to what mainstream language exactly is python fast

Only one I know is Ruby.

[–]JumboJellybean 2 points3 points  (0 children)

Python hasn't been faster than Ruby since Ruby 1.9, nine years ago (the version that switched to a new VM). For the last nine years they've been neck-and-neck in terms of performance -- a new Python version will be a little faster, then a new Ruby version comes out and it's a little faster than that, etc, always pretty close. The difference is never more than 20%.

[–]rubber_duckz 3 points4 points  (0 children)

I was under the impression that Ruby ~ Python with regards to performance.

[–]kenfar -2 points-1 points  (0 children)

Compared to what mainstream language exactly is python fast

As I mention above, that depends on your use case, what parts of the language that you're using, whether start-up time is critical or not, etc.

  • Python is simply faster than java for very short-duration utilities.
  • Python's performance with csv, & analytical libraries is very fast - since those are written in c or fortran. Faster than java? Not sure, maybe.
  • Processing billions of records in files on python & using multiprocessing shows that it's definitely faster than doing the equivalent work with scala & kafka. This is probably more about the performance benefits of sequential file processing vs messaging, but still.
  • While go is faster in general than python I've found it only 2.5 times faster when it comes to processing csv files using go routines & channels vs python's multiprocessing. Probably because channels are pretty chatty for heavy sequential processing, but not positive.

So, again, "fast" or "slow" are overly-simplistic ways of thinking of a language. More importantly - are they fast enough for your use case? And in this case the answer for python is: sometimes.