summaryrefslogtreecommitdiffstats
path: root/Documentation/BUG-HUNTING
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-11-14 00:00:13 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2014-11-14 10:49:04 +0100
commit063584d44377ebde5ebc6e99cedc1bc6561939d7 (patch)
treec7ce69f00f8b1edfd89ca621d51a590709b5f14f /Documentation/BUG-HUNTING
parentkvm: x86: increase user memory slots to 509 (diff)
downloadlinux-063584d44377ebde5ebc6e99cedc1bc6561939d7.tar.xz
linux-063584d44377ebde5ebc6e99cedc1bc6561939d7.zip
kvm: memslots: replace heap sort with an insertion sort pass
memslots is a sorted array. When a slot is changed, heapsort (lib/sort.c) would take O(n log n) time to update it; an optimized insertion sort will only cost O(n) on an array with just one item out of order. Replace sort() with a custom sort that takes advantage of memslots usage pattern and the known position of the changed slot. performance change of 128 memslots insertions with gradually increasing size (the worst case): heap sort custom sort max: 249747 2500 cycles with custom sort alg taking ~98% less then original update time. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Documentation/BUG-HUNTING')
0 files changed, 0 insertions, 0 deletions