From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: John Naylor <johncnaylorls@gmail.com>
Cc: Chiranmoy.Bhattacharya@fujitsu.com <Chiranmoy.Bhattacharya@fujitsu.com>
Cc: Devanga.Susmitha@fujitsu.com <Devanga.Susmitha@fujitsu.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Ragesh.Hajela@fujitsu.com <Ragesh.Hajela@fujitsu.com>
Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM.
Date: Fri, 17 Jan 2025 11:15:29 -0600
Message-ID: <Z4qQMS8EtYzN-eno@nathan> (raw)
In-Reply-To: <1519827.1736990839@sss.pgh.pa.us>
References: <Z4E-5oQGux-2R4iL@nathan>
<Z4GHNfhRKuA0r_Wn@nathan>
<CANWCAZZvXuJMgqMN4u068Yqa19CEjS31tQKZp_qFFFbgYfaXqQ@mail.gmail.com>
<622082.1736834344@sss.pgh.pa.us>
<Z4aXj_fJYCQ6GBbC@nathan>
<CANWCAZYNtrphdWSEakFbGrJZtjkFvvo8BB6nh5AGRiTfUu47Og@mail.gmail.com>
<1194263.1736925288@sss.pgh.pa.us>
<CANWCAZaq-hHGzEE9u=+ed3czdn6WUQdmGpmUpBiT7p+wNsOS+A@mail.gmail.com>
<CAApHDvpJr7r0n6TY_0psumA1uLy7+nmdq==L3jjDT-RYPMoHRw@mail.gmail.com>
<1519827.1736990839@sss.pgh.pa.us>
With commit e24d770 in place, I took a closer look at hex_decode(), and I
concluded that doing anything better without intrinsics would likely
require either a huge lookup table or something with complexity rivalling
the instrinsics approach (while also not rivalling its performance). So, I
took a closer look at the instrinsics patches and had the following
thoughts:
* The approach looks generally reasonable to me, but IMHO the code needs
much more commentary to explain how it works.
* The functions that test the length before potentially calling a function
pointer should probably be inlined (see pg_popcount() in pg_bitutils.h).
I wouldn't be surprised if some compilers are inlining this stuff
already, but it's probably worth being explicit about it.
* Finally, I think we should ensure we've established a really strong case
for this optimization. IME these intrinsics patches require a ton of
time and energy, and the code is often extremely complex. I would be
interested to see how your bytea test compares with the improvements
added in commit e24d770 and with sending the data in binary.
--
nathan
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, tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, johncnaylorls@gmail.com, Chiranmoy.Bhattacharya@fujitsu.com, Devanga.Susmitha@fujitsu.com, Ragesh.Hajela@fujitsu.com
Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM.
In-Reply-To: <Z4qQMS8EtYzN-eno@nathan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox