Re: Inline MemoryContextSwitchTo? - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Inline MemoryContextSwitchTo?
Date
Msg-id KGEFLMPJFBNNLNOOOPLGAEHMCIAA.simon@2ndquadrant.com
Whole thread Raw
In response to Re: Inline MemoryContextSwitchTo?  (Karel Zak <zakkr@zf.jcu.cz>)
Responses Re: Inline MemoryContextSwitchTo?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>Karel Zak wrote
> 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.

Yes, thats good.

But why MemoryContextSwitchTo ? That seems to come out much lower than
MemoryContextAllocZeroAligned or MemoryContextAlloc on the profiles I've
seen.

Best Regards, Simon Riggs



pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Thinking about breaking up the BufMgrLock
Next
From: Hannu Krosing
Date:
Subject: Is there a way to make VACUUM run completely outside transaction