pgsql: Speed up hex_encode with bytewise lookup

From: John Naylor <john(dot)naylor(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Speed up hex_encode with bytewise lookup
Date: 2025-01-17 09:38:00
Message-ID: E1tYing-0023U1-0N@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Speed up hex_encode with bytewise lookup

Previously, hex_encode looked up each nibble of the input
separately. We now use a larger lookup table containing the two-byte
encoding of every possible input byte, resulting in a 1/3 reduction
in encoding time.

Reviewed by Tom Lane, Michael Paquier, Nathan Bossart, David Rowley

Discussion: https://postgr.es/m/CANWCAZZvXuJMgqMN4u068Yqa19CEjS31tQKZp_qFFFbgYfaXqQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e24d77080b365265f3c854f64e71518622883678

Modified Files
--------------
src/backend/utils/adt/encode.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Dean Rasheed 2025-01-17 10:38:59 pgsql: Fix parsing of qualified relation names in RETURNING.
Previous Message Peter Eisentraut 2025-01-17 08:36:00 pgsql: Remove flex version checks