X-Original-To: pgsql-hackers@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id A4C65476369; Thu, 13 Mar 2003 17:04:04 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2DM45ub009697; Thu, 13 Mar 2003 17:04:05 -0500 (EST) To: Jean-Luc Lachance Cc: pgsql-hackers@postgresql.org, pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] Upgrading the backend's error-message infrastructure In-reply-to: <3E70FB55.68CEDE4@nsd.ca> References: <9168.1047588660@sss.pgh.pa.us> <3E70FB55.68CEDE4@nsd.ca> Comments: In-reply-to Jean-Luc Lachance message dated "Thu, 13 Mar 2003 16:42:45 -0500" Date: Thu, 13 Mar 2003 17:04:05 -0500 Message-ID: <9696.1047593045@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/576 X-Sequence-Number: 36822 Jean-Luc Lachance writes: > Why trade 5 characters for a 4 byte integer -- a saving of 1 byte? It's more than that: in one case you have something on the order of a "load immediate" instruction, whereas in the other case the code is like "load pointer to global string", plus you need a 6-byte string literal (maybe costing you 8 bytes depending on alignment considerations). Also, depending on your machine's approach to addressing of global data, that "load pointer" thingy could be multiple instructions. So we're talking about at least six, possibly 8-12 bytes per elog call --- and there are thousands of 'em in the backend. Admittedly, it's a micro-optimization, but it seems worth doing since it won't have any direct impact on code legibility. regards, tom lane