On 03/12/2026 15:43, Matthias van de Meent wrote: > On Thu, 3 Dec 2026 at 14:08, Andrei Lepikhov <[email protected]> wrote: >> >> On 03/12/2026 13:20, David Geier wrote: >>> A targeted benchmark tells us whether an optimization helps its >>> intended workload. It does not tell us what it costs elsewhere. >> >> I definitely disagree here. A targeted benchmark must expose all >> theoretically >> possible regressions. > > Producing a set of benchmarks that shows all theoretically possible > regressions might mean you'd first have to solve the halting problem, > because IIUC there are arbitrarily many things that could regress from > such a base component's code changes. E.g. increasing code size will > increase instruction cache usage by numeric-related code, which will > decrease the amount of other system's code in caches, and this will > affect any number of mixed workloads in various ways. That impact is > further influenced by the CPU's architecture, memory latencies, etc.
Rereading my previous email, I should confess it wasn't accurate. I am not an experienced English speaker and make mistakes (frequently). When I tried using AI translation, people immediately started complaining about AI slop ;). The code additions obviously change low-level cache behaviour. There is an infinite field of possibilities. No questions to anyone who wants to spend time inventing queries. My point is not to hide the fruit: each of these techniques might be used in multiple places, not just by numeric type. I basically think about ICU text fields and how costly their comparison is ==> sorting, hashing, etc. To get to the essence of these patches: There is quite a clear source of regressions - when the operator passes through each one of the checks and goes to the fallback path at the last one. So, to show the patch's potential regression, you just need to construct this case and test it as a part of different expressions. That's quite simple, I think. About the positive effect - it depends on the specific use case. In my case, ERPs always use typmod-ed numerics, typically at the same scale, with zero fallback calls, and the benchmark that covers these cases shows much better numbers than we discuss here. I wonder if other engineer will have their own typical use cases and speedup numbers. -- regards, Andrei Lepikhov, pgEdge
