Re: micro-optimizing json.c

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: micro-optimizing json.c
Дата
Msg-id 20231208033206.GA3479866@nathanxps13
обсуждение исходный текст
Ответ на Re: micro-optimizing json.c  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: micro-optimizing json.c  (John Naylor <johncnaylorls@gmail.com>)
Список pgsql-hackers
On Fri, Dec 08, 2023 at 04:11:52PM +1300, David Rowley wrote:
> + seplen = use_line_feeds ? sizeof(",\n ") - 1 : sizeof(",") - 1;
> 
> Most modern compilers will be fine with just:
> 
> seplen = strlen(sep);
> 
> I had to go back to clang 3.4.1 and GCC 4.1.2 to see the strlen() call
> with that code [1].

Hm.  I tried this first, but my compiler (gcc 9.4.0 on this machine) was
still doing the strlen()...

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: micro-optimizing json.c
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: micro-optimizing json.c