Andres Freund writes:
> Imo the code now is a bit odd, because we first switch (type) setting base,
> and then separately have branches for the different bases.
It'd be hard to merge, I think, given that the cases in the switch
don't line up one-for-one with the different bases. You could
probab
Hi,
On 2021-10-28 13:46:49 -0400, Tom Lane wrote:
> Personally, I failed to measure any speedup at all on pgbench, either
> in the init phase or regular transactions; whatever difference there
> may be is below the noise level. However, I wrote a simple C function
> with a tight loop around snpri
Chapman Flack writes:
> On 10/27/21 18:18, Arjan van de Ven wrote:
>> +/*
>> + * Special case each of the possible base values (8, 10, 16) to
>> avoid an
>> + * expensive divide operation
>> + * (the compiler will use a multiply, shift or boolean ops for this)
>> +
On 10/27/21 18:18, Arjan van de Ven wrote:
> +/*
> + * Special case each of the possible base values (8, 10, 16) to
> avoid an
> + * expensive divide operation
> + * (the compiler will use a multiply, shift or boolean ops for this)
> + */
Was 'boolean' the
On 10/26/2021 6:39 PM, Tom Lane wrote:
Japin Li writes:
Why do we need likely() for base=10, however, base=16 and base=8 don't need?
Yeah, I was a little unconvinced about that too. I concur with writing
it as an if/else chain instead of a switch, but I'm not sure that likely()
adds anything
Japin Li writes:
> Why do we need likely() for base=10, however, base=16 and base=8 don't need?
Yeah, I was a little unconvinced about that too. I concur with writing
it as an if/else chain instead of a switch, but I'm not sure that likely()
adds anything to that.
regard
On Wed, 27 Oct 2021 at 04:58, Arjan van de Ven wrote:
> [PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint
>
> fmtint() turns an integer into a string for a given base, and to do this
> it does a divide/modulo operation iteratively.
> The only possible ba
[PATCH v2] src/port/snprintf.c: Optimize the common base=10 case in fmtint
fmtint() turns an integer into a string for a given base, and to do this
it does a divide/modulo operation iteratively.
The only possible base values are 8, 10 and 16
On just about any CPU, divides are a pretty expensive