Skip to content

Commit c8a6b52

Browse files
committed
Further marginal speed hacking: in MemoryContextReset, don't call
MemoryContextResetChildren unless necessary.
1 parent fabef30 commit c8a6b52

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/utils/mmgr/mcxt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.54 2005/02/18 21:52:33 tgl Exp $
17+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.55 2005/05/14 23:16:29 tgl Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -123,7 +123,10 @@ MemoryContextReset(MemoryContext context)
123123
{
124124
AssertArg(MemoryContextIsValid(context));
125125

126-
MemoryContextResetChildren(context);
126+
/* save a function call in common case where there are no children */
127+
if (context->firstchild != NULL)
128+
MemoryContextResetChildren(context);
129+
127130
(*context->methods->reset) (context);
128131
}
129132

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy