Dumb Micro-Optimization

Started by PFCalmost 18 years ago1 messages
#1PFC
lists@peufeu.com

* 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