The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

Steven D'Aprano steve at pearwood.info
Thu Mar 24 09:50:15 EDT 2016


On Thu, 24 Mar 2016 02:24 pm, Chris Angelico wrote:


> This is how you're currently evaluating Python. Instead of starting
> with the most simple and obvious code 

One problem is that what counts as "simple and obvious" depends on what you
are used to. Coming from a background of Pascal, iterating over a list like
this:

for i in range(len(mylist)):
    print mylist[i]

was both simple and obvious. It took me years to break myself of that habit.

Likewise clearing a list:

for i in range(len(mylist)-1, -1, 0):
    del mylist[i]


Fortunately I didn't need to do that very often.

The point is that you, like most of the prominent posters here, have many
years of experience in programming in Python. How do you expect Bart to
come up with the same "simple and obvious" code as you?


> and refining from there, you're 
> starting from a whole lot of preconceived ideas about what's "fast" or
> "slow", and assuming/expecting that they'll all still be valid. 

Bart has done a much better job than most people at trying different things,
despite the hostility he's been receiving. I don't think he's fully in
the "dynamic scripting/glue/programming language" headspace, and I still
have some disagreements with some of his opinions, but he's actually shown
himself to be quite open to concrete suggestions made.

Bart, if you're reading, can I suggest that any future benchmarks should be
relatively constrained and short, so it is easier to read and understand
them, and suggest improvements. 



> Many 
> of them won't be, yet you still persist in doing things based on what
> you expect to be the case (because of what's fast/slow in C or some
> other language). We've explained this a number of times, and one by
> one, we're coming to the conclusion that you not only don't understand
> Python, you don't *want* to understand Python; and until you actually
> understand how the language works, timing stats are dubious.
> 
> Do you understand why people aren't taking your results very seriously?

You know what is missing from this conversation?

For one of Bart's critics to actually show faster code.

There's plenty of people telling him off for writing unpythonic and slow
code, but I haven't seen anyone actually demonstrating that Python is
faster than his results show.




-- 
Steven




More information about the Python-list mailing list