From b6a3aba8f9568684cf22af42584bec65b6170668 Mon Sep 17 00:00:00 2001
From: John Naylor <john.naylor@postgresql.org>
Date: Fri, 9 Jan 2026 17:07:37 +0700
Subject: [PATCH v11 2/3] Adjust benchmark to use core checksum

XXX not for commit
---
 contrib/pg_checksum_bench/pg_checksum_bench.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/contrib/pg_checksum_bench/pg_checksum_bench.c b/contrib/pg_checksum_bench/pg_checksum_bench.c
index dc20395a590..61da664e723 100644
--- a/contrib/pg_checksum_bench/pg_checksum_bench.c
+++ b/contrib/pg_checksum_bench/pg_checksum_bench.c
@@ -1,7 +1,6 @@
 #include "postgres.h"
 #include "fmgr.h"
-#include "port/checksum.h"
-#include "port/checksum_impl.h"
+#include "storage/checksum.h"
 
 #include <stdio.h>
 #include <assert.h>
@@ -15,23 +14,23 @@ Datum
 drive_pg_checksum(PG_FUNCTION_ARGS)
 {
 	int			page_count = PG_GETARG_INT32(0);
-	PGChecksummablePage *pages;
+	char *pages;
 	int			i;
 	size_t		j;
 
-	pages = palloc(page_count * sizeof(PGChecksummablePage));
+	pages = palloc(page_count * BLCKSZ);
 	srand(0);
-	for (j = 0; j < page_count * sizeof(PGChecksummablePage); j++)
+	for (j = 0; j < page_count * BLCKSZ; j++)
 	{
-		char	   *byte_ptr = (char *) pages;
+		char	   *byte_ptr =  pages;
 
 		byte_ptr[j] = rand() % 256;
 	}
 
 	for (i = 0; i < REPEATS; i++)
 	{
-		const PGChecksummablePage *test_page = pages + (i % page_count);
-		volatile uint32 result = pg_checksum_block_choose((const char *) test_page);
+		char *test_page = pages + (i % page_count);
+		volatile uint32 result = pg_checksum_page((char *) test_page, 0);
 
 		(void) result;
 	}
-- 
2.52.0

