Re: [PATCH] Hex-coding optimizations using SVE on ARM.

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: "Chiranmoy.Bhattacharya@fujitsu.com" <Chiranmoy.Bhattacharya@fujitsu.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, John Naylor <johncnaylorls@gmail.com>, David Rowley <dgrowleyml@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "Devanga.Susmitha@fujitsu.com" <Devanga.Susmitha@fujitsu.com>, "Ragesh.Hajela@fujitsu.com" <Ragesh.Hajela@fujitsu.com>
Date: 2025-09-22T20:05:44Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Optimize hex_encode() and hex_decode() using SIMD.

  2. Speed up hex_encode with bytewise lookup

Attachments

On Fri, Sep 12, 2025 at 04:30:21PM -0500, Nathan Bossart wrote:
> I've attached a new version of the patch with a simd.h version of
> hex_decode().  Here are the numbers:

I was able to improve the hex_decode() implementation a bit.

                arm
    buf  | HEAD  | patch | % diff
  -------+-------+-------+--------
      16 |    11 |    11 |    0
      64 |    38 |     7 |   82
     256 |   133 |    18 |   86
    1024 |   513 |    67 |   87
    4096 |  2037 |   271 |   87
   16384 |  8326 |  1103 |   87
   65536 | 34550 |  4475 |   87

                x86
    buf  | HEAD  | patch | % diff
  -------+-------+-------+--------
      16 |     8 |     9 |  -13
      64 |    38 |     7 |   82
     256 |   121 |    24 |   80
    1024 |   457 |    91 |   80
    4096 |  1797 |   356 |   80
   16384 |  7161 |  1411 |   80
   65536 | 28620 |  5632 |   80

-- 
nathan