(original) (raw)
Sorry, I may have missed some earlier relevant parts of this discussion.But you appear to be saying that you don't want to optimize something because it would be hard to explain why it performed better.
Eh?? Have I misunderstood?
Rob Cliffe
On 05/10/2013 23:35, Raymond Hettinger
wrote:
On Oct 5, 2013, at 12:42 PM, Serhiy Storchaka <storchaka@gmail.com> wrote:
Please remember me, what was common decision about CPython-only optimizations which change computation complexity?
IIRC, it is okay optimize C code for just about anything, but we don'twant to alter the pure python code after from idiomatic solutions thatwork on all of the implementations.
For example, there is a string concatenation optimizationin the C code, but we still use and advocate str.join()and try not to write code that relies on the optimization.That said, it is nice that less informed users are sometimessaved from an accidental performance trap.
Making bytearray's efficiently pop from the left side is dubious.This isn't a common idiom, nor should it be. Even if all theother implementations could model this behavior, it wouldn'tbe a good idea to have bytearrays have different performancecharacteristics than strings. Right now, it is not too hard toroughly explain the performance characteristics of the variouscontainer objects, but that would be imperiled a bit by havingbytearrays differing from strings in ways other than their size.
Raymond
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/rob.cliffe%40btinternet.com
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2242 / Virus Database: 3222/6225 - Release Date: 10/05/13