aboutsummaryrefslogtreecommitdiff
path: root/src/common/jsonapi.c
diff options
context:
space:
mode:
authorJohn Naylor <john.naylor@postgresql.org>2024-03-31 12:19:16 +0700
committerJohn Naylor <john.naylor@postgresql.org>2024-03-31 12:19:16 +0700
commit07f0f6abfc7f6c55cede528d9689dedecefc734a (patch)
tree6e6fb87400b6350c0328509384041c78b0ad3f42 /src/common/jsonapi.c
parentb1484a3f1910bfd0e254afe40085dfc3351bda8c (diff)
downloadpostgresql-07f0f6abfc7f6c55cede528d9689dedecefc734a.tar.gz
postgresql-07f0f6abfc7f6c55cede528d9689dedecefc734a.zip
Speed up tail processing when hashing aligned C strings
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. 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. The mask can be cheaply computed without knowing the terminator's position. We still need that position for the length calculation, but the CPU can now do that in parallel with other work, shortening the dependency chain. Ants Aasma and John Naylor Discussion: https://postgr.es/m/CANwKhkP7pCiW_5fAswLhs71-JKGEz1c1%2BPC0a_w1fwY4iGMqUA%40mail.gmail.com
Diffstat (limited to 'src/common/jsonapi.c')
0 files changed, 0 insertions, 0 deletions