aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorJohn Naylor <john.naylor@postgresql.org>2024-04-06 17:02:43 +0700
committerJohn Naylor <john.naylor@postgresql.org>2024-04-06 17:14:28 +0700
commita365d9e2e8c1ead27203a4431211098292777d3b (patch)
treef478cbdf91bd67aa3c17285838d40f4a9d5a0f5b /src/backend
parent0c25fee35903ef08af6d6b0c0fdb90fc01e37fa1 (diff)
downloadpostgresql-a365d9e2e8c1ead27203a4431211098292777d3b.tar.gz
postgresql-a365d9e2e8c1ead27203a4431211098292777d3b.zip
Speed up tail processing when hashing aligned C strings, take two
After encountering the NUL terminator, the word-at-a-time loop exits and we must hash the remaining bytes. Previously we calculated the terminator's position and re-loaded the remaining bytes from the input string. This was slower than the unaligned case for very short strings. We already have all the data we need in a register, so let's just mask off the bytes we need and hash them immediately. In addition to endianness issues, the previous attempt upset valgrind in the way it computed the mask. Whether by accident or by wisdom, the author's proposed method passes locally with valgrind 3.22. Ants Aasma, with cosmetic adjustments by me Discussion: https://postgr.es/m/CANwKhkP7pCiW_5fAswLhs71-JKGEz1c1%2BPC0a_w1fwY4iGMqUA%40mail.gmail.com
Diffstat (limited to 'src/backend')
0 files changed, 0 insertions, 0 deletions