git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 2de3c10) | patch
Improve sift up/down code in binaryheap.c and logtape.c.
2021年12月14日 18:35:22 +0000 (13:35 -0500)
2021年12月14日 18:35:22 +0000 (13:35 -0500)
commit a2ff18e89ff8f29677084bffd1e3de9ca6cd7224
Improve sift up/down code in binaryheap.c and logtape.c.

Borrow the logic that's long been used in tuplesort.c: instead
of physically swapping the data in two heap entries, keep the
value that's being sifted up or down in a local variable, and
just move the other values as necessary. This makes the code
shorter as well as faster. It's not clear that any current
callers are really time-critical enough to notice, but we
might as well code heap maintenance the same way everywhere.

Ma Liangzhu and Tom Lane

Discussion: https://postgr.es/m/17336-fc4e522d26a750fd@postgresql.org
src/backend/lib/binaryheap.c diff | blob | blame | history
src/backend/utils/sort/logtape.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /