From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jay Rolette Subject: Re: [PATCH] Avoid possible memory cpoy when sort hugepages Date: Wed, 10 Dec 2014 11:58:22 -0600 Message-ID: References: <1418178341-4193-1-git-send-email-michael.qiu@intel.com> <20141210104110.GB10056@bricha3-MOBL3> <533710CFB86FA344BFBF2D6802E60286C9E768@SHSMSX101.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258213BEA97@IRSMSX105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "dev-VfR2kkLFssw@public.gmane.org" To: "Ananyev, Konstantin" Return-path: In-Reply-To: <2601191342CEEE43887BDE71AB977258213BEA97-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On Wed, Dec 10, 2014 at 5:08 AM, Ananyev, Konstantin < konstantin.ananyev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 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