Commit 2576dcf
committed
Revert refactoring of hex code to src/common/
This is a combined revert of the following commits:
- c3826f8, a refactoring piece that moved the hex decoding code to
src/common/. This code was cleaned up by aef8948, as it originally
included no overflow checks in the same way as the base64 routines in
src/common/ used by SCRAM, making it unsafe for its purpose.
- aef8948, a more advanced refactoring of the hex encoding/decoding code
to src/common/ that added sanity checks on the result buffer for hex
decoding and encoding. As reported by Hans Buschmann, those overflow
checks are expensive, and it is possible to see a performance drop in
the decoding/encoding of bytea or LOs the longer they are. Simple SQLs
working on large bytea values show a clear difference in perf profile.
- ccf4e27, a cleanup made possible by aef8948.
The reverts of all those commits bring back the performance of hex
decoding and encoding back to what it was in ~13. Fow now and
post-beta3, this is the simplest option.
Reported-by: Hans Buschmann
Discussion: https://postgr.es/m/1629039545467.80333@nidsa.net
Backpatch-through: 141 parent 2313dda commit 2576dcf
File tree
9 files changed
+127
-304
lines changed- src
- backend
- replication
- utils/adt
- common
- include
- common
- utils
- tools/msvc
9 files changed
+127
-304
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | 153 | | |
156 | | - | |
157 | | - | |
158 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
| |||
178 | 176 | | |
179 | 177 | | |
180 | 178 | | |
181 | | - | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
| |||
188 | 185 | | |
189 | 186 | | |
190 | 187 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
195 | 191 | | |
196 | 192 | | |
197 | 193 | | |
| |||
311 | 307 | | |
312 | 308 | | |
313 | 309 | | |
314 | | - | |
| 310 | + | |
315 | 311 | | |
316 | | - | |
317 | 312 | | |
318 | 313 | | |
319 | 314 | | |
| |||
334 | 329 | | |
335 | 330 | | |
336 | 331 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
342 | 336 | | |
343 | 337 | | |
344 | 338 | | |
| |||
0 commit comments