forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitab5b4e2
committed
Speed up AllocSetFreeIndex, which is a significant cost in palloc and pfree,
by using a lookup table instead of a naive shift-and-count loop. Based oncode originally posted by Sean Eron Anderson athttp://graphics.stanford.edu/%7eseander/bithacks.html.Greg Stark did the research and benchmarking to show that this is whatwe should use. Jeremy Kerr first noticed that this is a hotspot thatcould be optimized, though we ended up not using his suggestion ofplatform-specific bit-searching code.1 parentf3f45c8 commitab5b4e2
1 file changed
+32
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
241 | 252 | | |
242 | 253 | | |
243 | 254 | | |
| |||
266 | 277 | | |
267 | 278 | | |
268 | 279 | | |
269 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
270 | 283 | | |
271 | | - | |
| 284 | + | |
272 | 285 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
279 | 300 | | |
280 | 301 | | |
| 302 | + | |
| 303 | + | |
281 | 304 | | |
282 | 305 | | |
283 | 306 | | |
| |||
0 commit comments
Comments
(0)