Re: glibc qsort() vulnerability - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: glibc qsort() vulnerability
Date
Msg-id B9DFF152-D31B-4E2D-A3DD-0AB92BFF71E4@yandex-team.ru
Whole thread Raw
In response to Re: glibc qsort() vulnerability  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: glibc qsort() vulnerability
Re: glibc qsort() vulnerability
List pgsql-hackers

> On 8 Feb 2024, at 06:52, Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> For the same compASC() test, I see an ~8.4% improvement with your int64
> code and a ~3.4% improvement with this:

If we care about branch prediction in comparison function, maybe we could produce sorting that inlines comparator, thus
eliminatingfunction call to comparator? We convert comparison logic to int, to extract comparison back then. 

I bet “call" is more expensive than “if".


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Printing backtrace of postgres processes
Next
From: Michael Paquier
Date:
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations