Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Upgrading the backend's error-message infrastructure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] Upgrading the backend's error-message infrastructure
Date: 2003-03-13 22:04:05
Message-ID: 9696.1047593045@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
Jean-Luc Lachance <jllachan(at)nsd(dot)ca> 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

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2003-03-13 22:17:33
Subject: Re: SQL99 ARRAY support proposal
Previous:From: Tom LaneDate: 2003-03-13 21:47:30
Subject: Re: Upgrading the backend's error-message infrastructure

pgsql-interfaces by date

Next:From: Tom LaneDate: 2003-03-13 22:40:35
Subject: Re: Roadmap for FE/BE protocol redesign
Previous:From: Tom LaneDate: 2003-03-13 21:47:30
Subject: Re: Upgrading the backend's error-message infrastructure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group