agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Mats Kindahl <mats@timescale.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: glibc qsort() vulnerability
Date: Wed, 7 Feb 2024 16:21:24 -0600
Message-ID: <20240207222124.GA382832@nathanxps13> (raw)
In-Reply-To: <20240207214857.rjqkutiaapka2xyp@awork3.anarazel.de>
References: <CA+14426g2Wa9QuUpmakwPxXFWG_1FaY0AsApkvcTBy-YfS6uaw@mail.gmail.com>
<508821.1707232276@sss.pgh.pa.us>
<20240206205305.GB3891538@nathanxps13>
<642084.1707252958@sss.pgh.pa.us>
<CA+14425TqyUZ3-O7zYsW6u85yY5diCz-p_TPQ2bZovn-N-fQ9A@mail.gmail.com>
<cc9b0272-849a-4a88-8200-59786d18b7a1@iki.fi>
<20240207214857.rjqkutiaapka2xyp@awork3.anarazel.de>
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
view thread (64+ messages) latest in thread
Message-ID: <20240207222124.GA382832@nathanxps13>
Permalink: ../20240207222124.GA382832@nathanxps13/
Also on: postgresql.org/message-id/20240207222124.GA382832@nathanxps13
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, andres@anarazel.de, hlinnaka@iki.fi, mats@timescale.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: glibc qsort() vulnerability
In-Reply-To: <20240207222124.GA382832@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox