Re: Upgrading the backend's error-message infrastructure
В списке pgsql-interfaces по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Upgrading the backend's error-message infrastructure |
| Дата | |
| Msg-id | 9696.1047593045@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Upgrading the backend's error-message infrastructure (Jean-Luc Lachance <jllachan@nsd.ca>) |
| Список | pgsql-interfaces |
Jean-Luc Lachance <jllachan@nsd.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
В списке pgsql-interfaces по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера