Re: [PATCH v2] kvm: memslots: replace heap sort with insertion sort

2014-11-14 Thread Igor Mammedov
On Fri, 14 Nov 2014 10:57:10 +0100 Paolo Bonzini wrote: > > > On 14/11/2014 00:00, Igor Mammedov wrote: > > memslots is a sorted array, when slot changes in it > > with current heapsort it would take O(n log n) time > > to update array, while using insertion sort like > > algorithm on array wit

Re: [PATCH v2] kvm: memslots: replace heap sort with insertion sort

2014-11-14 Thread Paolo Bonzini
On 14/11/2014 00:00, Igor Mammedov wrote: > memslots is a sorted array, when slot changes in it > with current heapsort it would take O(n log n) time > to update array, while using insertion sort like > algorithm on array with 1 item out of order will > take only O(n) time. > > Replace current h