Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v18I2-004tU1-Ig for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Sep 2025 19:03:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v18I1-007Xz5-8U for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Sep 2025 19:03:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v18I0-007Xyx-UR for pgsql-hackers@lists.postgresql.org; Tue, 23 Sep 2025 19:03:00 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v18Hy-002379-39 for pgsql-hackers@postgresql.org; Tue, 23 Sep 2025 19:03:00 +0000 Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-88432e60eebso142820639f.3 for ; Tue, 23 Sep 2025 12:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758654178; x=1759258978; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=QBJGqsLSSha3DxTab6+v3CMznRjo9FxH2f6lsxHzqso=; b=N3QKSIhLjJpKCakzQj4mXr56kKsPfk/TQS5iHyKffBTWOshVuKW2uXiusrGxIjMqLP J51ps12qSyaj7j6tB9nyKJoPWjAJQ+rkjwXR0Ckc4XT78dOjqGOgxBpgczl0L3zvOA6m hT4LE73o9+r0x8Inkcof6F2mCtg0OsWtPXgSCq8IhQVLTr5o0H0dCzDrspv3aqAM0JJd mz+jjMtZ2naqIWQZlDWIpWVP9j7DArhIgNtXdRVR3ePg0YdRIvlSrQV3DzJQ3HkleHco QRfmzP82VbyKXjHq9O48gKh4I9Soiu6ISexWAb68gJkscvNBwy/nwdEZPdrGtV0rMCzm Zkgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758654178; x=1759258978; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QBJGqsLSSha3DxTab6+v3CMznRjo9FxH2f6lsxHzqso=; b=X+GwbMZPKIG489ZpfyAPpFJjOTpqANRY1BRliTYkQb4q0Vaaj+1TaQjjwe6YMh6RMJ t9dbYBdr3jUtOO1m6VtxgWsBQrAB8jAwiugRL3I3O45pHH77LnAu7pspEyLdVsmKGoAk a1Omgwoe6mXEgXzZ9s4VN9o6pdHWJFxIImPpl6DOl5uzkbM0KrYjsbOjLLtpJRPv3A8P 1tjWdmPBDrbzZciLjAkNHkjdCbzYZGunDgwg+xQ7JIqJ1oGVw5GgOXrmzGNi/jbq7+Bb Kc1NZJjpDBHnOMjsq03iMndqRipISqSID61Hl6PeyyagY2OpzXrAmgP/AwGPusG6PqaK 6XuQ== X-Forwarded-Encrypted: i=1; AJvYcCWnlT4Q8ljLp7TJh1Ts7HkxZo0azexThyuoU7hVlQqXZwYeIUc+aPOLbKo9VtJ30x8uAb7ZxYU7SwlXzT1U@postgresql.org X-Gm-Message-State: AOJu0YwW8iuqOTGltbP7AW9WPR3kB9gSQqkY1PaE0WJwhpIxBPb3Y6Lj sQSxfIMFjTGwNnBET2CMf7W6onkYSHHqtyie5wMzkyYDIa40sIlMOI66 X-Gm-Gg: ASbGncsE3WzJPLkacAdekiX8vYF8Gc4ARox/HPACnxpAXk7LmHjBimWWy1SxYKyMOCO Aiws0YmlBPUT9O2iwY2TVrlvteHW+ZnyYIXltPpwesPRPz6rQmu/BJKFRMJ7HAW9Qt+U68W4jd7 Agj7hsNL/2N0YZ+zl5PI8tu/2pYur5e1mZEaXAWCeard4vBlbVmAU2WfL84MhVq4c4PEzx3Q+T8 WEIUQqnGc5hXRtr4L2OUgluKpkkn/kQywUi9nTbuEGu33ig9L96tHKUA9V7OmhH0h9FsuOAbh0F 7TbRWXs9swM8jvzJnNGfJ4nMadvXTWyXzKbHUF11nDdlW2LN4ysNHIA48rRU6gwy6fEbq0sgzPm Ag5BEy4mzXGcSjokyUkXgqhwdBHvb3gkkx88wLbbNNBzGNh8/8DdJU3r5c+lv8nYEC6ckS9XxWy ZjaVzqXzmqIMKi X-Google-Smtp-Source: AGHT+IEK92IoebwTrC+nUN9s34WIMkuK6pZCTA18a686o55t1FfExtWEk4OhIc+Wyec/ez/Htl49dQ== X-Received: by 2002:a05:6e02:164c:b0:424:80f2:2a8 with SMTP id e9e14a558f8ab-42581e0e64amr56343215ab.3.1758654177605; Tue, 23 Sep 2025 12:02:57 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-56339872772sm1271641173.33.2025.09.23.12.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Sep 2025 12:02:56 -0700 (PDT) Date: Tue, 23 Sep 2025 14:02:54 -0500 From: Nathan Bossart To: "Chiranmoy.Bhattacharya@fujitsu.com" Cc: Tom Lane , John Naylor , David Rowley , "pgsql-hackers@postgresql.org" , "Devanga.Susmitha@fujitsu.com" , "Ragesh.Hajela@fujitsu.com" Subject: Re: [PATCH] Hex-coding optimizations using SVE on ARM. Message-ID: References: <1787140.1757604720@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Sep 22, 2025 at 03:05:44PM -0500, Nathan Bossart wrote: > I was able to improve the hex_decode() implementation a bit. I took a closer look at how hex_decode() performs with smaller inputs. There are some small regressions, so I tried fixing them by adding the following to the beginning of the function: if (likely(tail_idx == 0)) return hex_decode_safe_scalar(src, len, dst, escontext); This helped a little, but it mostly just slowed things down for larger inputs on AArch64: arm buf | HEAD | patch | fix -------+-------+-------+------- 2 | 4 | 6 | 4 4 | 6 | 7 | 7 8 | 8 | 8 | 8 16 | 11 | 12 | 11 32 | 18 | 5 | 6 64 | 38 | 7 | 8 256 | 134 | 18 | 24 1024 | 514 | 67 | 100 4096 | 2072 | 280 | 389 16384 | 8409 | 1126 | 1537 65536 | 34704 | 4498 | 6128 x86 buf | HEAD | patch | fix -------+-------+-------+------- 2 | 2 | 2 | 2 4 | 3 | 3 | 3 8 | 4 | 4 | 4 16 | 8 | 9 | 8 32 | 23 | 5 | 5 64 | 37 | 7 | 7 256 | 122 | 24 | 24 1024 | 457 | 91 | 92 4096 | 1798 | 357 | 358 16384 | 7161 | 1411 | 1416 65536 | 28621 | 5630 | 5653 I didn't do this test for hex_encode(), but I'd expect it to follow a similar pattern. I'm tempted to suggest that these regressions are within tolerable levels and to forge on with v10. In any case, IMHO this patch is approaching committable quality, so I'd be grateful for any feedback. -- nathan