Re: Reduce one comparison in binaryheap's sift down

2024-10-30 Thread Nathan Bossart
On Wed, Oct 30, 2024 at 08:09:17AM -0400, Robert Haas wrote: > I would be delighted if you could take care of it. Committed. -- nathan

Re: Reduce one comparison in binaryheap's sift down

2024-10-30 Thread Robert Haas
On Tue, Oct 29, 2024 at 11:00 AM Nathan Bossart wrote: > On Tue, Oct 29, 2024 at 11:21:15AM +0800, cca5507 wrote: > > Agree, new version patch is attached. > > I might editorialize a bit, but overall this looks pretty good to me. > Robert, would you like to commit this, or shall I? I would be del

Re: Reduce one comparison in binaryheap's sift down

2024-10-29 Thread Nathan Bossart
On Tue, Oct 29, 2024 at 11:21:15AM +0800, cca5507 wrote: > Agree, new version patch is attached. I might editorialize a bit, but overall this looks pretty good to me. Robert, would you like to commit this, or shall I? -- nathan

Re: Reduce one comparison in binaryheap's sift down

2024-10-28 Thread cca5507
Agree, new version patch is attached. -- Regards, ChangAo Chen -- Original -- From: "Nathan Bossart"

Re: Reduce one comparison in binaryheap's sift down

2024-10-28 Thread Nathan Bossart
On Mon, Oct 28, 2024 at 12:40:20PM -0400, Robert Haas wrote: > Hmm, so at present we compare the parent to the left child and to the > right child. If it's smaller than neither, everything is OK. If it's > smaller than one, we swap it with that one. If it's smaller than both, > we compare the left

Re: Reduce one comparison in binaryheap's sift down

2024-10-28 Thread Robert Haas
On Mon, Oct 28, 2024 at 11:22 AM cca5507 wrote: > I think we can reduce one comparison in binaryheap's sift down, right? > > Here is a patch to fix it. Hmm, so at present we compare the parent to the left child and to the right child. If it's smaller than neither, everyt

Reduce one comparison in binaryheap's sift down

2024-10-28 Thread cca5507
Hi, I think we can reduce one comparison in binaryheap's sift down, right? Here is a patch to fix it. -- Regards, ChangAo Chen v1-0001-Reduce-one-comparison-in-binaryheap-s-sift-down.patch Description: Binary data