Commit 9753324
committed
Reduce overhead of cache-clobber testing in LookupOpclassInfo().
Commit 03ffc4d added logic to bypass all caching behavior in
LookupOpclassInfo when CLOBBER_CACHE_ALWAYS is enabled. It doesn't
look like I stopped to think much about what that would cost, but
recent investigation shows that the cost is enormous: it roughly
doubles the time needed for cache-clobber test runs.
There does seem to be value in this behavior when trying to test
the opclass-cache loading logic itself, but for other purposes the
cost is excessive. Hence, let's back off to doing this only when
debug_invalidate_system_caches_always is at least 3; or in older
branches, when CLOBBER_CACHE_RECURSIVELY is defined.
While here, clean up some other minor issues in LookupOpclassInfo.
Re-order the code so we aren't left with broken cache entries (leading
to later core dumps) in the unlikely case that we suffer OOM while
trying to allocate space for a new entry. (That seems to be my
oversight in 03ffc4d.) Also, in >= v13, stop allocating one array
entry too many. That's evidently left over from sloppy reversion in
851b14b.
Back-patch to all supported branches, mainly to reduce the runtime
of cache-clobbering buildfarm animals.
Discussion: https://postgr.es/m/1370856.1625428625@sss.pgh.pa.us1 parent c04c767 commit 9753324
1 file changed
+24
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1594 | 1594 | | |
1595 | 1595 | | |
1596 | 1596 | | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
1597 | 1601 | | |
1598 | 1602 | | |
1599 | 1603 | | |
1600 | 1604 | | |
1601 | | - | |
1602 | | - | |
1603 | | - | |
1604 | | - | |
1605 | 1605 | | |
1606 | 1606 | | |
1607 | 1607 | | |
| |||
1610 | 1610 | | |
1611 | 1611 | | |
1612 | 1612 | | |
1613 | | - | |
| 1613 | + | |
1614 | 1614 | | |
1615 | 1615 | | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
1620 | | - | |
1621 | | - | |
1622 | | - | |
| 1616 | + | |
1623 | 1617 | | |
1624 | 1618 | | |
1625 | 1619 | | |
1626 | 1620 | | |
1627 | 1621 | | |
1628 | 1622 | | |
1629 | 1623 | | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1635 | 1632 | | |
1636 | 1633 | | |
1637 | | - | |
| 1634 | + | |
1638 | 1635 | | |
1639 | 1636 | | |
1640 | 1637 | | |
1641 | 1638 | | |
1642 | 1639 | | |
1643 | 1640 | | |
1644 | 1641 | | |
1645 | | - | |
1646 | | - | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
1647 | 1651 | | |
1648 | 1652 | | |
1649 | 1653 | | |
| |||
0 commit comments