From: Jeff Davis <pgsql@j-davis.com>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Should io_method=worker remain the default?
Date: Fri, 05 Sep 2025 16:07:09 -0700
Message-ID: <1b50102876dc9564049c985cff0ec1903cc8d502.camel@j-davis.com> (raw)
In-Reply-To: <a81f2f7ef34afc24a89c613671ea017e3651329c.camel@j-davis.com>
References: <d68e2a4f8c356107e5167408ad80eaa2fac0f57d.camel@j-davis.com>
<adywrhdn5zcfeldzug2pkzbdxizactr46goh4doiztvexrqomy@lgvl26gui63a>
<a81f2f7ef34afc24a89c613671ea017e3651329c.camel@j-davis.com>
On Fri, 2025-09-05 at 13:25 -0700, Jeff Davis wrote:
> As an aside, I'm building with meson using -Dc_args="-msse4.2 -Wtype-
> limits -Werror=missing-braces". But I notice that the meson build
> doesn't seem to use -funroll-loops or -ftree-vectorize when building
> checksums.c. Is that intentional? If not, perhaps slower checksum
> calculations explain my results.
Attached a patch. I'm not sure if it's the right way to do things, but
the resulting compiler command seems right to me.
It doesn't affect my tests in this thread much, but it seems best to be
consistent with autoconf.
Regards,
Jeff Davis
Attachments:v1-0001-meson-build-checksums-with-extra-optimization-fla.patch (text/x-patch, 1.1K) download
From d714e93aa7d2493e394659142bbd3f378aa0f050 Mon Sep 17 00:00:00 2001
From: Jeff Davis <jeff@j-davis.com>
Date: Fri, 5 Sep 2025 15:41:35 -0700
Subject: [PATCH v1] meson: build checksums with extra optimization flags.
Use -funroll-loops and -ftree-vectorize when building checksum.c to
match what autoconf does.
Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea017e3651329c.camel@j-davis.com
---
src/backend/storage/page/meson.build | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/backend/storage/page/meson.build b/src/backend/storage/page/meson.buildindex c3e4a805862..112f00ff365 100644--- a/src/backend/storage/page/meson.build+++ b/src/backend/storage/page/meson.build@@ -1,7 +1,15 @@
# Copyright (c) 2022-2025, PostgreSQL Global Development Group
+checksum_backend_lib = static_library('checksum_backend_lib',+ 'checksum.c',+ dependencies: backend_build_deps,+ kwargs: internal_lib_args,+ c_args: vectorize_cflags + unroll_loops_cflags,+)++backend_link_with += checksum_backend_lib+
backend_sources += files(
'bufpage.c',
- 'checksum.c',
'itemptr.c',
)
--
2.43.0
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: pgsql-hackers@postgresql.org
Cc: pgsql@j-davis.com, andres@anarazel.de
Subject: Re: Should io_method=worker remain the default?
In-Reply-To: <1b50102876dc9564049c985cff0ec1903cc8d502.camel@j-davis.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox