Re: Slim down integer formatting

2021-07-27 Thread David Rowley
On Wed, 28 Jul 2021 at 14:25, David Fetter wrote: > Intuitively, I'd expect us to get things in the neighborhood of 1 a > lot more often than things in the neighborhood of 1 << (30 or 60). Do > we have some idea of the distribution, or at least of the distribution > family, that we should expect

Re: Slim down integer formatting

2021-07-27 Thread David Fetter
On Wed, Jul 28, 2021 at 01:17:43PM +1200, David Rowley wrote: > On Wed, 28 Jul 2021 at 01:44, Alvaro Herrera wrote: > > So how much faster is it than the original? > > I only did some very quick tests. They're a bit noisey. The results > indicate an average speedup of 1.7%, but the noise level i

Re: Slim down integer formatting

2021-07-27 Thread David Rowley
On Wed, 28 Jul 2021 at 01:44, Alvaro Herrera wrote: > So how much faster is it than the original? I only did some very quick tests. They're a bit noisey. The results indicate an average speedup of 1.7%, but the noise level is above that, so unsure. create table a (a int); insert into a select a

Re: Slim down integer formatting

2021-07-27 Thread Alvaro Herrera
On 2021-Jul-26, David Fetter wrote: > Folks, > > Please find attached a patch to do $subject. It's down to a one table > lookup and 3 instructions. So how much faster is it than the original? -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "La rebeldía es la v

Re: Slim down integer formatting

2021-07-26 Thread Greg Nancarrow
On Tue, Jul 27, 2021 at 3:08 PM Andrew Gierth wrote: > > In short, please don't include d2s_intrinsics.h from anywhere other than > d2s.c > Thanks for the clarification. The patch author will need to take this into account for the patch's div1e8() usage. Regards, Greg Nancarrow Fujitsu Australi

Re: Slim down integer formatting

2021-07-26 Thread Andrew Gierth
> "David" == David Rowley writes: David> I think the mistake is that the header file is not in David> src/include/common. For some reason, it's ended up with all the David> .c files in src/common. David> I imagine Andrew did this because he didn't ever expect anything David> else to hav

Re: Slim down integer formatting

2021-07-26 Thread David Rowley
On Tue, 27 Jul 2021 at 15:08, Greg Nancarrow wrote: > > On Tue, Jul 27, 2021 at 12:42 PM Michael Paquier wrote: > > > > #include "common/int.h" > > +#include "d2s_intrinsics.h" > > Er, are you sure about this part? The first version of the patch did > > that in a different, also incorrect, way.

Re: Slim down integer formatting

2021-07-26 Thread Greg Nancarrow
On Tue, Jul 27, 2021 at 12:42 PM Michael Paquier wrote: > > #include "common/int.h" > +#include "d2s_intrinsics.h" > Er, are you sure about this part? The first version of the patch did > that in a different, also incorrect, way. Er, I was just trying to help out, so at least the patch could be

Re: Slim down integer formatting

2021-07-26 Thread David Rowley
On Tue, 27 Jul 2021 at 14:42, Michael Paquier wrote: > When applying some micro-benchmarking to stress those APIs, how much > does this change things? At the end of the day, this also comes down > to an evaluation of pg_ulltoa_n() and pg_ultoa_n(). I'd suggest something like creating a table wit

Re: Slim down integer formatting

2021-07-26 Thread Michael Paquier
On Tue, Jul 27, 2021 at 12:28:22PM +1000, Greg Nancarrow wrote: > That patch didn't apply for me (on latest source) so I've attached an > equivalent with those changes, that does apply, and also tweaks the > Makefile include path to address that #include issue. When applying some micro-benchmarkin

Re: Slim down integer formatting

2021-07-26 Thread Greg Nancarrow
On Tue, Jul 27, 2021 at 9:51 AM David Fetter wrote: > > In covering the int64 versions, I swiped a light weight division from > the Ryu stuff. I'm pretty sure that what I did is not how to do > #includes, but it's a PoC. What would be a better way to do this? > That patch didn't apply for me (o

Slim down integer formatting

2021-07-26 Thread David Fetter
Folks, Please find attached a patch to do $subject. It's down to a one table lookup and 3 instructions. In covering the int64 versions, I swiped a light weight division from the Ryu stuff. I'm pretty sure that what I did is not how to do #includes, but it's a PoC. What would be a better way to