Marginal performance hack: remove the loop that used to be needed to
Tom Lane <tgl@sss.pgh.pa.us>
Marginal performance hack: remove the loop that used to be needed to look through a freelist for a chunk of adequate size. For a long time now, all elements of a given freelist have been exactly the same allocated size, so we don't need a loop. Since the loop never iterated more than once, you'd think this wouldn't matter much, but it makes a noticeable savings in a simple test --- perhaps because the compiler isn't optimizing on a mistaken assumption that the loop would repeat. AllocSetAlloc is called often enough that saving even a couple of instructions is worthwhile.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/mmgr/aset.c | modified | +7 −18 |