public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zou Nan hai <nanhai.zou@intel.com>
To: Matt Mackall <mpm@selenic.com>
Cc: keios <keios.cn@gmail.com>, LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] low performance of lib/sort.c , kernel 2.6.18
Date: 29 Sep 2006 06:34:28 +0800	[thread overview]
Message-ID: <1159482868.5251.22.camel@linux-znh> (raw)
In-Reply-To: <20060928223341.GI6412@waste.org>

On Fri, 2006-09-29 at 06:33, Matt Mackall wrote:
> On Thu, Sep 28, 2006 at 11:18:45PM +0800, keios wrote:
> > It is a non-standard heap-sort algorithm implementation because the
> > index of child node is wrong . The sort function still outputs right
> > result, but the performance is O( n * ( log(n) + 1 ) ) , about 10% ~
> > 20% worse than standard algorithm .
> >
> > Signed-off-by: keios <keios.cn@gmail.com>
> 
> Was a bit mystified by this as your patch matches what I've got
> in my userspace test harness from 2003.
> 
> Here's what I submitted, which is almost the same as yours:
> 
> http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.11-rc4/2.6.11-rc4-mm1/broken-out/lib-sort-heapsort-implementation-of-sort.patch
> 
> Then Zou Nan hai sent Andrew a fix for an off-by-one bug here (merged
> with my patch):
> 
> http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.11/2.6.11-mm1/broken-out/lib-sort-heapsort-implementation-of-sort.patch
> 
> ..which introduced the performance regression.
> 
> And then I subsequently tweaked my local copy for use in another
> project, coming up with your version.
> 
> So this passes my test harness just fine (for both even and odd array
> sizes).
> 
> Acked-by: Matt Mackall <mpm@selenic.com>

 
  I think this patch is correct. 

  Thanks
  Zou Nan hai

  reply	other threads:[~2006-09-29  0:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-28 15:18 [PATCH] low performance of lib/sort.c , kernel 2.6.18 keios
2006-09-28 22:33 ` Matt Mackall
2006-09-28 22:34   ` Zou Nan hai [this message]
2006-09-29  1:56   ` keios

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=1159482868.5251.22.camel@linux-znh \
    --to=nanhai.zou@intel.com \
    --cc=akpm@osdl.org \
    --cc=keios.cn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.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