On Fri, May 14, 2021 at 12:26:23AM -0400, Tom Lane wrote: > I then tried a really dumb xor'ing implementation, and > that gives me a slowdown of 2.2%. This could undoubtedly > be improved on further, say by unrolling the loop or > processing multiple bytes at once. One problem with it > is that I suspect it will tend to concentrate the entropy > into the third/fourth and seventh/eighth bytes of the > accumulator, since so many of the fields being jumbled > are 4-byte or 8-byte fields with most of the entropy in > their low-order bits. Probably that could be improved > with a bit more thought -- say, an extra bump of the > nextbyte pointer after each field. > > Anyway, I think that what we have here is quite an inferior > implementation, and we can do better with some more thought.
Considering what even a simple query has to do, I am still baffled why such a computation takes ~2%, though it obviously does since you have confirmed that figure. -- Bruce Momjian <br...@momjian.us> https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.