Re: Inline MemoryContextSwitchTo?

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: List pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Inline MemoryContextSwitchTo?
Date: 2005-02-07 08:13:09
Message-ID: 1107763989.3518.8.camel@petra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2005-02-06 at 18:05 -0500, Tom Lane wrote:
> Can anyone think of a reason we aren't inlining MemoryContextSwitchTo()
> in GCC builds, similarly to the way list_head() et al are handled?
>
> It wouldn't be a huge gain, but I consistently see MemoryContextSwitchTo
> eating a percent or three of most profiles.

Sounds good.

I think we can inlining all MemoryContext functions which check memory
context header and call context->metods->...() only. An example
MemoryContextAlloc() that is very often called from code too.

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-02-07 08:28:09 Re: Inline MemoryContextSwitchTo?
Previous Message Simon Riggs 2005-02-07 08:10:00 Re: Thinking about breaking up the BufMgrLock