summaryrefslogtreecommitdiffstats
path: root/openstack/common/db
diff options
context:
space:
mode:
authorStanislaw Pitucha <stanislaw.pitucha@hp.com>2013-04-08 15:03:55 +0100
committerStanislaw Pitucha <stanislaw.pitucha@hp.com>2013-04-09 13:06:13 +0100
commit9dcf688ea80f52cdb5413514198b2aa81d5a4e09 (patch)
treede2d00c7a9677c6f81305d4d8608ac3eb5eeb6c2 /openstack/common/db
parentf9207b31f9599d9c8970ad3a3ae5f1e3720526fe (diff)
downloadoslo-9dcf688ea80f52cdb5413514198b2aa81d5a4e09.tar.gz
oslo-9dcf688ea80f52cdb5413514198b2aa81d5a4e09.tar.xz
oslo-9dcf688ea80f52cdb5413514198b2aa81d5a4e09.zip
Optimise to_primitive common cases
to_primitive included many checks that were executed before any usual types have been checked. It's safe to reorder / duplicate the most common ones. Especially built-in types can be checked before other more complicated scenarios. This is important since to_primitive gets called over a million times in usual test run and many more times in a live environment. This change strips around 4% of nova testing time on my machine and the function itself is ~5x faster on average according to the profiler. Change-Id: I71e0c06bbcc31793a1cdcebb36d4e3d8c5876f73
Diffstat (limited to 'openstack/common/db')
0 files changed, 0 insertions, 0 deletions