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

Jay Rolette rolette at infiniteio.com
Wed Dec 10 18:58:22 CET 2014


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.

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.

Jay


More information about the dev mailing list