Re: Simplifying our Trap/Assert infrastructure - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Simplifying our Trap/Assert infrastructure
Date
Msg-id 140401.1665429608@sss.pgh.pa.us
Whole thread Raw
In response to Re: Simplifying our Trap/Assert infrastructure  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
Nathan Bossart <nathandbossart@gmail.com> writes:
> On Sun, Oct 09, 2022 at 05:08:39PM -0400, Tom Lane wrote:
>> Something I thought about but forgot to mention in the initial email:
>> is it worth sprinkling these macros with "unlikely()"?

> I don't see why not.

I experimented with that, and found something that surprised me:
there's a noticeable code-bloat effect.  With the patch as given,

$ size src/backend/postgres 
   text    data     bss     dec     hex filename
9001199   86280  204496 9291975  8dc8c7 src/backend/postgres

but with unlikely(),

$ size src/backend/postgres 
   text    data     bss     dec     hex filename
9035423   86280  204496 9326199  8e4e77 src/backend/postgres

I don't quite understand why that's happening, but it seems to
show that this requires some investigation of its own.  So for
now I just pushed the patch as-is.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)
Next
From: Tom Lane
Date:
Subject: Re: Reducing the chunk header sizes on all memory context types