Python and the need for speed

bart4858 at gmail.com bart4858 at gmail.com
Wed Apr 12 14:27:04 EDT 2017


On Wednesday, 12 April 2017 16:50:01 UTC+1, Jussi Piitulainen  wrote:
> bart4858 at gmail.com writes:
> 
> > On Wednesday, 12 April 2017 12:56:32 UTC+1, Jussi Piitulainen  wrote:
> >> bartc writes:
> >> 
> >
> >> > These are straightforward language enhancements.
> >> 
> >> FYI, the question is not how to optimize the code but how to prevent
> >> the programmer from writing stupid code in the first place. Someone
> >> suggested that a language should do that.
> >
> > The 'stupid code' thing is a red herring. I assume the code people
> > write is there for a reason.
> 
> So you walked in to a conversation about something that does not
> interest you and simply started talking about your own thing.
> 
> Because of course you did.
> 
> I get confused when you do that.

Huh? The subject is making Python faster. It's generally agreed that being very dynamic makes that harder, everything else being equal.

I don't agree that stopping people writing silly code is that helpful. It might be in the itself silly example of 'for i in range(10): x+=1', but usually there will be a good reason for such a loop.

If you want to argue that bad choices of algorithm and bad code are a factor in performance, then there's that too. But that applies equally to every language.

You can choose the best algorithm and perfectly correct code, and Python will still most likely execute it more slowely than a less dynamic language.

If by some chance Python is faster, then it will probably be because it's offloading the real work to some library, not written in Python.


More information about the Python-list mailing list