v4-0005-Try-a-larger-CompactAttribute-struct-without-bitf.patch

application/octet-stream

Filename: v4-0005-Try-a-larger-CompactAttribute-struct-without-bitf.patch
Type: application/octet-stream
Part: 5
Message: Re: Make tuple deformation faster

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v4-0005
Subject: Try a larger CompactAttribute struct without bitflags
File+
src/include/access/tupdesc.h 7 7
From c5ce7a7b6b06d8a6cb708582e7b8f5da4e25ad33 Mon Sep 17 00:00:00 2001
From: David Rowley <dgrowley@gmail.com>
Date: Tue, 3 Sep 2024 14:05:30 +1200
Subject: [PATCH v4 5/6] Try a larger CompactAttribute struct without bitflags

Benchmarks have shown that making the CompactAttribute struct larger and
getting rid of the flags to reduce the bitwise-ANDing requirements makes
things go faster.
---
 src/include/access/tupdesc.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h
index 9854b05c9d..cf776f7186 100644
--- a/src/include/access/tupdesc.h
+++ b/src/include/access/tupdesc.h
@@ -55,13 +55,13 @@ typedef struct CompactAttribute
 	int32		attcacheoff;	/* fixed offset into tuple, if known, or -1 */
 	int16		attlen;			/* attr len in bytes or -1 = varlen, -2 =
 								 * cstring */
-	bool		attbyval:1;		/* as FormData_pg_attribute.attbyval */
-	bool		attispackable:1;	/* FormData_pg_attribute.attstorage !=
-									 * TYPSTORAGE_PLAIN */
-	bool		atthasmissing:1;	/* as FormData_pg_attribute.atthasmissing */
-	bool		attisdropped:1; /* as FormData_pg_attribute.attisdropped */
-	bool		attgenerated:1; /* FormData_pg_attribute.attgenerated != '\0' */
-	bool		attnotnull:1;	/* as FormData_pg_attribute.attnotnull */
+	bool		attbyval;		/* as FormData_pg_attribute.attbyval */
+	bool		attispackable;	/* FormData_pg_attribute.attstorage !=
+								 * TYPSTORAGE_PLAIN */
+	bool		atthasmissing;	/* as FormData_pg_attribute.atthasmissing */
+	bool		attisdropped;	/* as FormData_pg_attribute.attisdropped */
+	bool		attgenerated;	/* FormData_pg_attribute.attgenerated != '\0' */
+	bool		attnotnull;		/* as FormData_pg_attribute.attnotnull */
 	uint8		attalignby;		/* alignment requirement in bytes */
 } CompactAttribute;
 
-- 
2.34.1