public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andres Freund <[email protected]>
To: Bharath Rupireddy <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Refactor CheckpointWriteDelay()
Date: Sat, 19 Feb 2022 13:50:59 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CALj2ACUR5uvmdPtyksD+7pe=P9cH+0dV9Q7dNHLx28PDGZxPHA@mail.gmail.com>
References: <CALj2ACUR5uvmdPtyksD+7pe=P9cH+0dV9Q7dNHLx28PDGZxPHA@mail.gmail.com>

Hi,

On 2022-02-10 17:31:55 +0530, Bharath Rupireddy wrote:
> Secondly, remove the function ImmediateCheckpointRequested() and read
> the ckpt_flags from the CheckpointerShmem with volatile qualifier.
> This saves some LOC and cost = dirty buffers written to disk * one
> function call cost.

The compiler can just inline ImmediateCheckpointRequested(). We don't gain
anything by inlining it ourselves.


> I did a small experiment[1] with a use case [2] on my dev system where
> I measured the total time spent in CheckpointWriteDelay() with and
> without patch, to my surprise, I didn't see much difference. It may be
> my experiment is wrong, my dev box doesn't show much diff and others
> may or may not notice the difference. Despite this, the patch proposed
> still helps IMO as it saves a few LOC (16) and I'm sure it will also
> save some time for standalone backend checkpoints.

I am not surprised that you're not seeing a benefit. Compared to the cost of
writing out a buffer the cost of the function call here is neglegible.

I don't think this is an improvement at all. Imagine what happens if we add a
second callsite to CheckpointWriteDelay() or
ImmediateCheckpointRequested()...


Greetings,

Andres Freund






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Refactor CheckpointWriteDelay()
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox