| От | Neil Conway |
|---|---|
| Тема | appendStringInfoString() micro-opt |
| Дата | |
| Msg-id | 87y8rwae2d.fsf@mailbox.samurai.com обсуждение исходный текст |
| Ответы |
Re: appendStringInfoString() micro-opt
|
| Список | pgsql-patches |
This patch replaces a bunch of call sites of appendStringInfo() with appendStringInfoString(). (For those without the code in front of you, the difference between these two functions is that the former takes a sprintf-style format string and a variable list of arguments, whereas the latter just takes a single NUL-terminated string; therefore, the latter is faster if you're just appending a single string to the buffer). For the sake of minimizing how much of my time I've wasted if someone objects, this patch only changes a portion of the call sites that could be changed; I'll do the rest before committing the patch. I was tempted to make appendStringInfoString() a macro, since (a) it's just one line of code (b) I'd expect plenty of compilers to be smart enough to optimize-out a strlen() on a string-literal arg. The downside is that it would require that appendStringInfoString() evaluate its arguments more than once. Any comments on whether this is worth doing? Unless anyone objects, I intend to apply the full version of this patch within 48 hours. -Neil
В списке pgsql-patches по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера