Further marginal speed hacking: in MemoryContextReset, don't call
authorTom Lane <[email protected]>
Sat, 14 May 2005 23:16:29 +0000 (23:16 +0000)
committerTom Lane <[email protected]>
Sat, 14 May 2005 23:16:29 +0000 (23:16 +0000)
MemoryContextResetChildren unless necessary.

src/backend/utils/mmgr/mcxt.c

index 925fdb9868bcd37e8434a58cdf04655050f3ba61..bcc397799a23c1feb7cc9f5450b46d86209b5123 100644 (file)
@@ -123,7 +123,10 @@ MemoryContextReset(MemoryContext context)
 {
        AssertArg(MemoryContextIsValid(context));
 
-       MemoryContextResetChildren(context);
+       /* save a function call in common case where there are no children */
+       if (context->firstchild != NULL)
+               MemoryContextResetChildren(context);
+
        (*context->methods->reset) (context);
 }