Re: glibc qsort() vulnerability

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: glibc qsort() vulnerability
Дата
Msg-id 20240207222124.GA382832@nathanxps13
обсуждение исходный текст
Ответ на Re: glibc qsort() vulnerability  (Andres Freund <andres@anarazel.de>)
Ответы Re: glibc qsort() vulnerability  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Wed, Feb 07, 2024 at 01:48:57PM -0800, Andres Freund wrote:
> Now, in most cases this won't matter, the sorting isn't performance
> critical. But I don't think it's a good idea to standardize on a generally
> slower pattern.
> 
> Not that that's a good test, but I did quickly benchmark [1] this with
> intarray. There's about a 10% difference in performance between using the
> existing compASC() and one using
>     return (int64) *(const int32 *) a - (int64) *(const int32 *) b;
> 
> 
> Perhaps we could have a central helper for this somewhere?

Maybe said helper could use __builtin_sub_overflow() and fall back to the
slow "if" version only if absolutely necessary.  The assembly for that
looks encouraging, but I still need to actually test it...

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: James Coleman
Дата:
Сообщение: Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING
Следующее
От: Peter Smith
Дата:
Сообщение: Re: Question about behavior of deletes with REPLICA IDENTITY NOTHING