[dpdk-dev] [PATCH] Avoid possible memory cpoy when sort hugepages

Ananyev, Konstantin konstantin.ananyev at intel.com
Wed Dec 10 19:39:24 CET 2014


 
> From: Jay Rolette [mailto:rolette at infiniteio.com]
> Sent: Wednesday, December 10, 2014 5:58 PM
> To: Ananyev, Konstantin
> Cc: Qiu, Michael; Richardson, Bruce; dev at 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 <konstantin.ananyev at intel.com> 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


More information about the dev mailing list