Commit f5ae3ba
committed
Make tbm_add_tuples more efficient by caching the last acccessed page.
When adding a large number of tuples to a TID bitmap using
tbm_add_tuples() sometimes a lot of time was spent looking up a page's
entry in the bitmap's internal hashtable.
Improve efficiency by caching the last accessed page, while iterating
over the passed in tuples, hoping consecutive tuples will often be on
the same page. In many cases that's a good bet, and in the rest the
added overhead isn't big.
Discussion: 54479A85.8060309@sigaev.ru
Author: Teodor Sigaev
Reviewed-By: David Rowley1 parent aa1d2fc commit f5ae3ba
1 file changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
278 | | - | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
290 | 298 | | |
291 | 299 | | |
292 | 300 | | |
| |||
303 | 311 | | |
304 | 312 | | |
305 | 313 | | |
| 314 | + | |
306 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
307 | 319 | | |
308 | 320 | | |
309 | 321 | | |
| |||
0 commit comments