Skip to content

Commit 413c184

Browse files
committed
Refactor AllocSetAlloc(), separating hot and cold paths
Allocating from a free list or from a block which contains enough space already, 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 one for a large allocation, we deem to be less common, therefore we class that as "cold". Both cold paths require a malloc so are going to be slower as a result of that regardless. The main motivation here is to remove the calls to malloc() in the hot path and because of this, the compiler is now free to not bother setting up the stack frame in AllocSetAlloc(), thus making the hot path much cheaper. Author: Andres Freund Reviewed-by: David Rowley Discussion: https://postgr.es/m/[email protected]
1 parent afd8ef3 commit 413c184

File tree

1 file changed

+268
-213
lines changed

1 file changed

+268
-213
lines changed

0 commit comments

Comments
 (0)