Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Pull up isReset flag from AllocSetContext to MemoryContext struc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Pull up isReset flag from AllocSetContext to MemoryContext struc
Date: 2011-05-22 18:18:06
Message-ID: 26356.1306088286@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committers
Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> writes:
> Pull up isReset flag from AllocSetContext to MemoryContext struct. This
> avoids the overhead of one function call when calling MemoryContextReset(),
> and it seems like the isReset optimization would be applicable to any new
> memory context we might invent in the future anyway.

> This buys back the overhead I just added in previous patch to always call
> MemoryContextReset() in ExecScan, even when there's no quals or projections.

Do you actually have any measurements that prove that?  This seems like
a rather ugly destruction of a modularity boundary in return for a
hypothetical performance gain.  I'm also concerned that you've probably
added cycles on net to MemoryContextAlloc (where it's no longer possible
to tail-call AllocSetAlloc), which could very easily cost more cycles on
most workloads than could ever be saved by making MemoryContextReset a
shade faster.

			regards, tom lane

In response to

Responses

pgsql-committers by date

Next:From: Tom LaneDate: 2011-05-22 19:17:15
Subject: pgsql: Make plpgsql provide the typmods for its variables to the mainp
Previous:From: Peter EisentrautDate: 2011-05-22 17:07:43
Subject: pgsql: Clarify the documentation of the --with-ossp-uuid option

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group