| От | Nathan Bossart |
|---|---|
| Тема | Re: micro-optimizing json.c |
| Дата | |
| Msg-id | 20231208040209.GA3526669@nathanxps13 обсуждение исходный текст |
| Ответ на | Re: micro-optimizing json.c (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: micro-optimizing json.c
|
| Список | pgsql-hackers |
On Thu, Dec 07, 2023 at 10:28:50PM -0500, Tom Lane wrote: > Nathan Bossart <nathandbossart@gmail.com> writes: >> I did both of these in v2, although I opted to test that the first >> character after the optional '-' was a digit instead of testing that it was >> _not_ an 'I' or 'N'. > > Yeah, I thought about that too after sending my message. This version > LGTM, although maybe the comment could be slightly more verbose with > explicit reference to Inf/NaN as being the cases we need to quote. Done. >> I think there are some similar improvements that we can make for >> JSONTYPE_BOOL and JSONTYPE_CAST, but I haven't tested them yet. > > I am suspicious of using > > appendStringInfo(result, "\"%s\"", ...); > > in each of these paths; snprintf is not a terribly cheap thing. > It might be worth expanding that to appendStringInfoChar/ > appendStringInfoString/appendStringInfoChar. WFM. I'll tackle JSONTYPE_BOOL and JSONTYPE_CAST next... -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера