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: "Devanga.Susmitha@fujitsu.com" <Devanga.Susmitha@fujitsu.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "Ragesh.Hajela@fujitsu.com" <Ragesh.Hajela@fujitsu.com>
Date: 2025-01-13T16:18:03Z
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 →
-
Optimize hex_encode() and hex_decode() using SIMD.
- ec8719ccbfcd 19 (unreleased) landed
-
Speed up hex_encode with bytewise lookup
- e24d77080b36 18.0 landed
On Mon, Jan 13, 2025 at 03:48:49PM +0000, Chiranmoy.Bhattacharya@fujitsu.com wrote: > There is a 30% improvement using auto-vectorization. It might be worth enabling auto-vectorization independently of any patches that use intrinsics, then. > Currently, it is assumed that all aarch64 machine support NEON, but for > newer advanced SIMD like SVE (and AVX512 for x86) this assumption may not > hold. We need a runtime check to be sure.. Using src/include/port/simd.h > to abstract away these advanced SIMD implementations may be difficult. Yeah, moving simd.h to anything beyond Neon/SSE2 might be tricky at the moment. Besides the need for additional runtime checks, using wider registers can mean that you need more data before an optimization takes effect, which is effectively a regression. I ran into this when I tried to add AVX2 support to simd.h [0]. My question about using simd.h was ultimately about abstracting the relevant Neon/SSE2 instructions and using those for hex_encode/decode(). If that's possible, I think it'd be interesting to see how that compares to the SVE version. [0] https://postgr.es/m/20231129171526.GA857928%40nathanxps13 -- nathan