- Notifications
You must be signed in to change notification settings - Fork4.9k
Commita97bbe1
committed
Reduce branches in heapgetpage()'s per-tuple loop
Until now, heapgetpage()'s loop over all tuples performed some conditionalchecks for each tuple, even though condition did not change across the loop.This commit fixes that by moving the loop into an inline function. By callingit with different constant arguments, the compiler can generate an optimizedloop for the different conditions, at the price of two per-page checks.For cases of all-visible tables and an isolation level other thanserializable, speedups of up to 25% have been measured.Reviewed-by: John Naylor <johncnaylorls@gmail.com>Reviewed-by: Zhang Mingli <zmlpostgres@gmail.com>Tested-by: Quan Zongliang <quanzongliang@yeah.net>Discussion:https://postgr.es/m/20230716015656.xjvemfbp5fysjiea@awork3.anarazel.deDiscussion:https://postgr.es/m/2ef7ff1b-3d18-2283-61b1-bbd25fc6c7ce@yeah.net1 parent41c51f0 commita97bbe1
1 file changed
+74
-28
lines changedLines changed: 74 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
364 | 364 |
| |
365 | 365 |
| |
366 | 366 |
| |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
367 | 417 |
| |
368 | 418 |
| |
369 | 419 |
| |
| |||
379 | 429 |
| |
380 | 430 |
| |
381 | 431 |
| |
382 |
| - | |
383 |
| - | |
384 | 432 |
| |
| 433 | + | |
385 | 434 |
| |
386 | 435 |
| |
387 | 436 |
| |
| |||
403 | 452 |
| |
404 | 453 |
| |
405 | 454 |
| |
406 |
| - | |
407 | 455 |
| |
408 | 456 |
| |
409 | 457 |
| |
| |||
426 | 474 |
| |
427 | 475 |
| |
428 | 476 |
| |
| 477 | + | |
| 478 | + | |
429 | 479 |
| |
430 |
| - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
431 | 487 |
| |
432 |
| - | |
433 |
| - | |
434 |
| - | |
435 |
| - | |
436 |
| - | |
437 |
| - | |
438 |
| - | |
439 |
| - | |
440 |
| - | |
441 |
| - | |
442 |
| - | |
443 |
| - | |
444 |
| - | |
445 |
| - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
446 | 491 |
| |
447 |
| - | |
448 |
| - | |
449 |
| - | |
450 |
| - | |
451 |
| - | |
452 |
| - | |
453 |
| - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
454 | 503 |
| |
455 | 504 |
| |
456 | 505 |
| |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 | 506 |
| |
461 | 507 |
| |
462 | 508 |
| |
|
0 commit comments
Comments
(0)