yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #46576
[Bug 1405772] Re: Don't use dict constructor with a sequence of length-2 sequences
These kind of micro optimizations aren't relevant to our codebase.
Please never submit patches for things like this.
** Changed in: nova
Status: Confirmed => Won't Fix
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1405772
Title:
Don't use dict constructor with a sequence of length-2 sequences
Status in OpenStack Compute (nova):
Won't Fix
Bug description:
EP-0274 introduced dict comprehensions to replace dict constructor
with a sequence of length-2 sequences, these are benefits copied
from [1]:
The dictionary constructor approach has two distinct disadvantages
from the proposed syntax though. First, it isn't as legible as a
dict comprehension. Second, it forces the programmer to create an
in-core list object first, which could be expensive.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].
[1]http://legacy.python.org/dev/peps/pep-0274/
[2]http://doughellmann.com/2012/11/12/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2.html
[3]http://paste.openstack.org/show/154798/
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1405772/+subscriptions
References