swift/swift/common/ring
Yuriy Taraday 34fa05f66b Various optimizations to RingBuilder.rebalance()
Overall gain is about 20-22% of time on my laptop. This includes:

* replacing string sort_key with a tuple (because we can and because
  compairing two 3-tuples is faster than comparing two 26-byte strings);
* keeping track of hungriest dev in tier (allows us to use built-in
  dict.__getitem__ as a key instead of lambdas in couple of places);
* remove unnecessary sorted() call in the innermost loop (because we
  don't need to sort all of them or better we don't need to sort
  anything there);
* memoize tiers for each dev (saves just a couple of percents but why
  not).

Performance measurments have been done using this script:
http://paste.openstack.org/show/55609/

Related-Bug: #1262166
Related-Bug: #1261659
Change-Id: If38bd9fe82efc12b01e9aa146e0f4ab565fb6bea
2013-12-20 16:13:26 +04:00
..
__init__.py Switched some relative imports to be absolute 2013-09-13 10:36:54 -07:00
builder.py Various optimizations to RingBuilder.rebalance() 2013-12-20 16:13:26 +04:00
ring.py Update handoff algorithm to use IP/port pairs 2013-12-02 17:41:38 -08:00
utils.py in case you lose your builder backups 2013-11-20 21:11:45 -08:00