From: Tom Lane Date: Sat, 14 May 2005 23:16:29 +0000 (+0000) Subject: Further marginal speed hacking: in MemoryContextReset, don't call X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=db837f15f2f6ca35e6f47f492f0afe885054e1d4;p=users%2Fbernd%2Fpostgres.git Further marginal speed hacking: in MemoryContextReset, don't call MemoryContextResetChildren unless necessary. --- diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c index 925fdb9868..bcc397799a 100644 --- a/src/backend/utils/mmgr/mcxt.c +++ b/src/backend/utils/mmgr/mcxt.c @@ -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); }