Re: pg_basebackup: removed an unnecessary use of memset in FindStreamingStart

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: yangyz <1197620467(at)qq(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_basebackup: removed an unnecessary use of memset in FindStreamingStart
Date: 2026-02-25 12:41:04
Message-ID: 4972EBFA-46C0-4431-8392-4EDA58BB6CF0@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Feb 25, 2026, at 18:21, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>
>> On 25 Feb 2026, at 07:31, yangyz <1197620467(at)qq(dot)com> wrote:
>
>> 2.Performance Overhead
>> In each iteration, the entire buffer of size LZ4_CHUNK_SZ (potentially several megabytes) is zero-initialized. Since these memory blocks are immediately overwritten by decompressed data, this zeroing operation constitutes an unnecessary consumption of CPU resources.
>
> When proposing a performance improvement it's important to provide some level
> of benchmarks to show the improvement. Is removing this memset noticeable?
>
> --
> Daniel Gustafsson
>

I don’t think this patch is about performance. Although removing the memset might save a few CPU cycles, the real benefit seems to be cleanup and consistency. The memset appears unnecessary, and similar functions don’t use it, so I think this change mainly improves maintainability.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-02-25 12:46:40 Re: Enable partitionwise join for partition keys wrapped by RelabelType
Previous Message Aleksander Alekseev 2026-02-25 12:26:21 Passing mac-addresses by value?