Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oX650-0000kU-9q for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Sep 2022 19:23:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oX64z-0001mu-60 for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Sep 2022 19:23:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oX64y-0001ml-T1 for pgsql-hackers@lists.postgresql.org; Sat, 10 Sep 2022 19:23:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oX64u-0006tw-C2 for pgsql-hackers@lists.postgresql.org; Sat, 10 Sep 2022 19:23:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 28AJNejY597493; Sat, 10 Sep 2022 15:23:40 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Splitting up guc.c In-reply-to: <20220910191533.4d7xib46m62sf2mv@awork3.anarazel.de> References: <587607.1662836699@sss.pgh.pa.us> <20220910191533.4d7xib46m62sf2mv@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 10 Sep 2022 12:15:33 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <597491.1662837820.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 10 Sep 2022 15:23:40 -0400 Message-ID: <597492.1662837820@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-09-10 15:04:59 -0400, Tom Lane wrote: >> $ size guc*o >> text data bss dec hex filename >> 13653 4 112 13769 35c9 guc-file.o >> 54953 0 564 55517 d8dd guc.o >> 6951 0 112 7063 1b97 guc_hooks.o >> 43570 62998 216 106784 1a120 guc_tables.o > A tad surprised by the text size of guc_tables.o - not that it is a prob= lem, > just seems a bit odd. There's a pretty fair number of constant tables that got moved to there. Not to mention all the constant strings. >> Before proceeding further, I wanted to ask for comments on a design >> choice that might be controversial. Even though I don't want to >> invent guc_hooks.c, I think we *should* invent guc_hooks.h, and >> consolidate all the GUC hook function declarations there. The >> point would be to not have to #include guc.h in headers of unrelated >> modules. This is similar to what we've done with utils/fmgrprotos.h, >> though the motivation is different. I already moved a few declarations >> from guc.h to there (and in consequence had to adjust #includes in >> the modules defining those hooks), but there's a lot more to be done >> if we apply that policy across the board. Does anybody think that's >> a bad approach, or have a better one? > Hm, I'm not opposed, the reasoning makes sense to me. How would this int= eract > with the declaration of the variables underlying GUCs? I'd still declare the variables as we do now, ie just straightforwardly export them from the associated modules. Since they're all of native C types, they don't cause any inclusion-footprint issues. We could move their declarations to a common file I guess, but I don't see any benefit. regards, tom lane