forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit413c184
committed
Refactor AllocSetAlloc(), separating hot and cold paths
Allocating from a free list or from a block which contains enough spacealready, we deem to be common code paths and want to optimize for those.Having to allocate a new block, either a normal block or a dedicated onefor a large allocation, we deem to be less common, therefore we classthat as "cold". Both cold paths require a malloc so are going to beslower as a result of that regardless.The main motivation here is to remove the calls to malloc() in the hotpath and because of this, the compiler is now free to not bother settingup the stack frame in AllocSetAlloc(), thus making the hot path muchcheaper.Author: Andres FreundReviewed-by: David RowleyDiscussion:https://postgr.es/m/20210719195950.gavgs6ujzmjfaiig@alap3.anarazel.de1 parentafd8ef3 commit413c184
1 file changed
+268
-213
lines changed0 commit comments
Comments
(0)