nova/nova
ChangBo Guo(gcb) 69fef14509 Performance: leverage dict comprehension in PEP-0274
PEP-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.
Nova dropped python 2.6 support, we can leverage this now.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].
Note: This commit doesn't handle dict constructor with kwagrs.
This commit also adds a hacking rule.

[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/

Change-Id: Ifb5cb05b9cc2b8758d5a8e34f7792470a73d7c40
2015-01-16 10:06:13 +08:00
..
CA
api Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
cells Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
cert Remove havana compat from nova.cert.rpcapi 2014-11-22 01:10:05 +00:00
cloudpipe Fixes potential reliablity issue with missing CONF import 2014-09-26 13:48:25 +09:30
cmd Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
compute Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
conductor Unshelving a volume backed instance doesn't work 2014-12-30 21:59:01 -08:00
console Make LOG exception use format_message 2015-01-07 08:38:34 +08:00
consoleauth Replacement `_` on `_LW` in all LOG.warning part 1 2014-11-20 11:19:16 +02:00
db Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
hacking Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
image Reuse methods from netutils 2014-12-29 14:47:20 +00:00
ipv6
keymgr Replacement `_` on `_LW` in all LOG.warning part 1 2014-11-20 11:19:16 +02:00
locale Imported Translations from Transifex 2015-01-04 06:14:28 +00:00
network Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
objects Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
objectstore
openstack oslo: remove useless modules 2015-01-15 11:27:11 +01:00
pci Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
rdp
scheduler Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
servicegroup remove pylint source code annotations 2015-01-08 13:26:32 +00:00
spice
storage rename oslo.concurrency to oslo_concurrency 2014-12-06 23:30:05 +08:00
tests Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
virt Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
vnc Deduplicate some INFO and AUDIT level messages 2014-11-13 15:25:40 +11:00
volume Merge "Fix get_all API to pass search option filter to cinder api" 2014-12-23 06:21:13 +00:00
__init__.py move eventlet GREENDNS override to top level 2014-12-08 17:41:03 -05:00
availability_zones.py
baserpc.py Switch to nova's jsonutils in oslo.serialization 2014-10-14 11:35:05 +00:00
block_device.py Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
config.py Set logging level for glanceclient to WARN 2014-10-21 10:59:43 -04:00
context.py Prevent admin role leak in context.elevated 2014-11-24 22:58:05 +00:00
crypto.py rename oslo.concurrency to oslo_concurrency 2014-12-06 23:30:05 +08:00
debugger.py Replacement `_` on `_LW` in all LOG.warning part 1 2014-11-20 11:19:16 +02:00
exception.py Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
filters.py Make scheduler filters/weighers only load once 2014-12-09 18:58:49 +01:00
hooks.py Update hooks from oslo-incubator copy 2014-10-28 01:24:31 +00:00
i18n.py Remove unused modules copied from oslo-incubator 2014-10-15 01:28:42 +00:00
loadables.py Use oslo.utils 2014-10-06 21:41:17 -04:00
manager.py
netconf.py Specify storage IP for iscsi connector 2014-11-13 11:06:11 -06:00
notifications.py Merge "Make notifications use Instance.get_flavor()" 2014-11-24 06:43:30 +00:00
paths.py
policy.py
quota.py Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
rpc.py Switch to nova's jsonutils in oslo.serialization 2014-10-14 11:35:05 +00:00
safe_utils.py
service.py Use osapi_compute worker for api v2 service 2014-12-16 16:35:31 -08:00
test.py Merge "Fix and re-gate on H306" 2015-01-13 06:48:19 +00:00
utils.py Merge "Move metadata filtering logic to utils.py" 2015-01-07 18:10:22 +00:00
version.py Replacement `_` on `_LE` in all LOG.error 2014-10-21 06:40:05 +00:00
weights.py Make scheduler filters/weighers only load once 2014-12-09 18:58:49 +01:00
wsgi.py Merge "Eventlet green threads not released back to pool" 2014-12-02 13:04:26 +00:00