Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16
Дата
Msg-id CAEZATCV4sC7-pMDi3JV3rT9HVHjvJtAku_CaX0Jxk1HvDgCLxw@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16  ("Joel Jacobson" <joel@compiler.org>)
Ответы Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16  ("Joel Jacobson" <joel@compiler.org>)
Список pgsql-hackers
On Sun, 22 Jan 2023 at 13:42, Joel Jacobson <joel@compiler.org> wrote:
>
> Hi,
>
> On platforms where we support 128bit integers, we could accelerate division
> when the number of digits in the divisor is larger than 8 and less than or
> equal to 16 digits, i.e. when the divisor that fits in a 64-bit integer but would
> not fit in a 32-bit integer.
>

Seems like a reasonable idea, with some pretty decent gains.

Note, however, that for a divisor having fewer than 5 or 6 digits,
it's now significantly slower because it's forced to go through
div_var_int64() instead of div_var_int() for all small divisors. So
the var2ndigits <= 2 case needs to come first.

The implementation of div_var_int64() should be in an #ifdef HAVE_INT128 block.

In div_var_int64(), s/ULONG_MAX/PG_UINT64_MAX/

Regards,
Dean



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: run pgindent on a regular basis / scripted manner
Следующее
От: Himanshu Upadhyaya
Дата:
Сообщение: Re: HOT chain validation in verify_heapam()