qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow down with: 'Make "info qom-tree" show children sorted'


From: Paolo Bonzini
Subject: Re: Slow down with: 'Make "info qom-tree" show children sorted'
Date: Tue, 7 Jul 2020 11:06:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 07/07/20 10:46, Daniel P. Berrangé wrote:
> On Tue, Jul 07, 2020 at 06:45:57AM +0200, Thomas Huth wrote:
>> Sure, we can work around that problem in the CI (Alex has already a
>> patch queued), but still, is there something you could do about this
>> massive slowdown?
> 
> I think the answer is to stop using q_queue_insert_sorted(). The impl of
> it looks like it is quadratic in complexity. Instead store the objects
> in a plain array and then use qsort() at the end.

g_list_sort uses a mergesort, so it's a good choice as well.  But yeah
GPtrArray is another possibility.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]