Re: [PATCH] Optimize json_lex_string by batching character copying

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: [PATCH] Optimize json_lex_string by batching character copying
Дата
Msg-id CAFBsxsGzaaGLF=Nuq61iRXTyspbO9rOjhSqFN=V6ozzmta5mXg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Optimize json_lex_string by batching character copying  (Andres Freund <andres@anarazel.de>)
Ответы Re: [PATCH] Optimize json_lex_string by batching character copying  (John Naylor <john.naylor@enterprisedb.com>)
Список pgsql-hackers

On Mon, Jul 11, 2022 at 11:07 PM Andres Freund <andres@anarazel.de> wrote:

> I wonder if we can add a somewhat more general function for scanning until
> some characters are found using SIMD? There's plenty other places that could
> be useful.

In simple cases, we could possibly abstract the entire loop. With this particular case, I imagine the most approachable way to write the loop would be a bit more low-level:

while (p < end - VECTOR_WIDTH &&
       !vector_has_byte(p, '\\') &&
       !vector_has_byte(p, '"') &&
       vector_min_byte(p, 0x20))
    p += VECTOR_WIDTH

I wonder if we'd lose a bit of efficiency here by not accumulating set bits from the three conditions, but it's worth trying.
--
John Naylor
EDB: http://www.enterprisedb.com

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

Предыдущее
От: "Fujii.Yuki@df.MitsubishiElectric.co.jp"
Дата:
Сообщение: RE: WIP: Aggregation push-down - take2
Следующее
От: Richard Guo
Дата:
Сообщение: Re: Making Vars outer-join aware