1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Tweak a few of the most heavily used function call points to zero out

just the significant fields of FunctionCallInfoData, rather than MemSet'ing
the whole struct to zero.  Unused positions in the arg[] array will
thereby contain garbage rather than zeroes.  This buys back some of the
performance hit from increasing FUNC_MAX_ARGS.  Also tweak tuplesort.c
code for more speed by marking some routines 'inline'.  All together
these changes speed up simple sorts, like count(distinct int4column),
by about 25% on a P4 running RH Linux 7.2.
This commit is contained in:
Tom Lane
2002-10-04 17:19:55 +00:00
parent 53c5edace8
commit 3b8ba163d0
3 changed files with 261 additions and 188 deletions

View File

@ -46,7 +46,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.88 2002/09/28 20:00:19 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.89 2002/10/04 17:19:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -275,8 +275,18 @@ advance_transition_function(AggStatePerAgg peraggstate,
}
}
/* OK to call the transition function */
MemSet(&fcinfo, 0, sizeof(fcinfo));
/*
* OK to call the transition function
*
* This is heavily-used code, so manually zero just the necessary fields
* instead of using MemSet(). Compare FunctionCall2().
*/
/* MemSet(&fcinfo, 0, sizeof(fcinfo)); */
fcinfo.context = NULL;
fcinfo.resultinfo = NULL;
fcinfo.isnull = false;
fcinfo.flinfo = &peraggstate->transfn;
fcinfo.nargs = 2;
fcinfo.arg[0] = peraggstate->transValue;