forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit07f0f6a
committed
Speed up tail processing when hashing aligned C strings
After encountering the NUL terminator, the word-at-a-time loop exitsand we must hash the remaining bytes. Previously we calculated theterminator's position and re-loaded the remaining bytes from the inputstring. We already have all the data we need in a register, so let'sjust mask off the bytes we need and hash them immediately. The mask canbe cheaply computed without knowing the terminator's position. We stillneed that position for the length calculation, but the CPU can nowdo that in parallel with other work, shortening the dependency chain.Ants Aasma and John NaylorDiscussion:https://postgr.es/m/CANwKhkP7pCiW_5fAswLhs71-JKGEz1c1%2BPC0a_w1fwY4iGMqUA%40mail.gmail.com1 parentb1484a3 commit07f0f6a
1 file changed
+34
-10
lines changedLines changed: 34 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
219 | 219 |
| |
220 | 220 |
| |
221 | 221 |
| |
222 |
| - | |
| 222 | + | |
223 | 223 |
| |
| 224 | + | |
224 | 225 |
| |
225 | 226 |
| |
226 | 227 |
| |
| |||
239 | 240 |
| |
240 | 241 |
| |
241 | 242 |
| |
242 |
| - | |
| 243 | + | |
243 | 244 |
| |
244 | 245 |
| |
245 | 246 |
| |
| |||
254 | 255 |
| |
255 | 256 |
| |
256 | 257 |
| |
257 |
| - | |
258 |
| - | |
259 |
| - | |
260 |
| - | |
261 |
| - | |
262 |
| - | |
263 |
| - | |
264 |
| - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
265 | 289 |
| |
266 | 290 |
| |
267 | 291 |
| |
|
0 commit comments
Comments
(0)