Dumb Micro-Optimization

From: PFC <lists(at)peufeu(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Dumb Micro-Optimization
Date: 2008-04-10 11:20:11
Message-ID: op.t9d63xejcigqcu@apollo13.peufeu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


* Dumb Optimization #1:

- Add executorFunc function pointer to struct PlanState
- in ExecProcNode.c -> ExecProcNode() :
- upon first execution, set executorFunc to the function corresponding to
node type
- next calls use function pointer

Effect : removes a switch (nodeTag(node)) which otherwise executes for
every tuple returned by every node
Gain :
- 4% CPU time on SELECT sum(an integer column) FROM a table of one million
rows
- nil on selects returning few rows obviously

Browse pgsql-hackers by date

  From Date Subject
Next Message Martin Edlman 2008-04-10 11:34:06 Re: pl/PgSQL, variable names in NEW
Previous Message Dave Cramer 2008-04-10 10:44:20 Re: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work