DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jay Rolette <rolette@infiniteio.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] Avoid possible memory cpoy when sort hugepages
Date: Wed, 10 Dec 2014 11:58:22 -0600	[thread overview]
Message-ID: <CADNuJVr9airTPGpy9r_PD7ys6GRhmabTS22OmCkQr+UbM5WgoQ@mail.gmail.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB977258213BEA97@IRSMSX105.ger.corp.intel.com>

On Wed, Dec 10, 2014 at 5:08 AM, Ananyev, Konstantin <
konstantin.ananyev@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

  reply	other threads:[~2014-12-10 17:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10  2:25 Michael Qiu
2014-12-10 10:41 ` Bruce Richardson
2014-12-10 10:59   ` Qiu, Michael
2014-12-10 11:08     ` Ananyev, Konstantin
2014-12-10 17:58       ` Jay Rolette [this message]
     [not found]         ` <2601191342CEEE43887BDE71AB977258213BED0C@IRSMSX105.ger.corp.intel.com>
2014-12-10 18:39           ` Ananyev, Konstantin
2014-12-10 21:36             ` Jay Rolette
2014-12-11  1:44               ` Qiu, Michael

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADNuJVr9airTPGpy9r_PD7ys6GRhmabTS22OmCkQr+UbM5WgoQ@mail.gmail.com \
    --to=rolette@infiniteio.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).