nova/nova/compute
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
..
monitors Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
resources Replacement `_` on `_LW` in all LOG.warning part 3 2014-12-04 13:43:32 +02:00
__init__.py Use oslo.utils 2014-10-06 21:41:17 -04:00
api.py Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
arch.py Add amd64 to arch.canonicalize() 2014-09-08 08:08:00 -07:00
build_results.py Compute Add build_instance hook in compute manager 2014-12-04 10:12:00 -05:00
cells_api.py Merge "Add support for clean_shutdown to rescue in compute api layer" 2014-12-11 14:08:38 +00:00
claims.py objects: move numa host and cell to objects 2014-12-01 03:51:58 -05:00
delete_types.py Allow force-delete irrespective of VM task_state 2014-10-14 21:06:22 -07:00
flavors.py Expand valid resource name character set 2014-12-18 06:51:14 -06:00
hv_type.py compute: rename hvtype.py to hv_type.py 2014-11-20 11:26:39 +00:00
instance_actions.py Add missing instance action record for start of live migration 2014-09-24 10:14:42 +08:00
manager.py Performance: leverage dict comprehension in PEP-0274 2015-01-16 10:06:13 +08:00
power_state.py Remove underscore for the STATE_MAP variable 2014-02-17 03:01:45 -08:00
resource_tracker.py Merge "Add host field when missing from compute_node" 2015-01-08 18:41:26 +00:00
rpcapi.py Fix live migration RPC compatibility with older versions 2015-01-12 14:18:30 -08:00
stats.py Switch to nova's jsonutils in oslo.serialization 2014-10-14 11:35:05 +00:00
task_states.py Recover from REBOOT-* state on compute manager start-up 2014-03-12 10:00:54 +00:00
utils.py Replacement `_` on `_LW` in all LOG.warning part 3 2014-12-04 13:43:32 +02:00
vm_mode.py virt: use compute.vm_mode constants and validate vm mode type 2014-09-16 15:32:40 +01:00
vm_states.py Recover from REBOOT-* state on compute manager start-up 2014-03-12 10:00:54 +00:00