On 20/11/2026 09:14, David Geier wrote: >> It's attached. I saw really good results on x86 but some regressions on >> M5. That's why I started working on centralizing the case distinction >> work scattered throughout all the macros in set_var_from_num() and have >> all functions use that. This also makes the code a lot nicer. This >> change isn't complete yet, so I cannot send it to you. >> >> I'll share the results on my box with you tomorrow. Right now, I don't >> have access to my benchmark machine. > > Attached are the results from my AMD Ryzen 7 9700X. You can see that > there are lots of speedups but also lots of regressions. The regressions > stem from the additional case distinction for if it's a packed / > unpacked varlena that are repeatedly scattered throughout the code via > the NUMERIC_ macros. I wonder what your compiler is. I test these numeric-related patches on Intel/AMD/ARM platforms with clang/gcc. For GCC, I do recommend using -mstringop-strategy=libcall. It hides the performance issue in GCC 12-15. For production code, I usually use a small, non-committable hack that transforms memcpy(..,..,N) into a series of memcpy(..,..,8).
-- regards, Andrei Lepikhov, pgEdge
