Thread (1 message) 1 message, 1 author, 2014-12-10

Re: [PATCH] Avoid possible memory cpoy when sort hugepages

From: Ananyev, Konstantin <hidden>
Date: 2014-12-10 18:39:24

 
From: Jay Rolette [mailto:rolette@infiniteio.com]
Sent: Wednesday, December 10, 2014 5:58 PM
To: Ananyev, Konstantin
Cc: Qiu, Michael; Richardson, Bruce; dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] Avoid possible memory cpoy when sort hugepages


On Wed, Dec 10, 2014 at 5:08 AM, Ananyev, Konstantin [off-list ref] wrote:
I wonder why we do need to write our own bubble sort procedure?
Why we can't use standard qsort() here?

Sadly, even bubble sort would be better than the selection sort being used here. It's guaranteed to be O(n^2) in all cases.
Ah yes, your right it is a selection sort here.
I just got through replacing that entire function in my repo with a call to qsort() from the standard library last night myself. Faster
(although probably not material to most deployments) and less code.
If you feel like it is worth it, why not to submit a patch? :)
Thanks
Konstantin
Jay
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help