Re: Efficient output for integer types

2020-01-11 Thread Tomas Vondra
Hi, Any plans regarding committing this patch? I see the thread is silent since September 24, when the last patch version was posted. The patch is already marked as RFC since December, when David changed the status. I don't have any opinion whether the patch is RFC or not (it might well be), but

Re: Efficient output for integer types

2019-09-23 Thread David Fetter
On Mon, Sep 23, 2019 at 01:16:36PM +0100, Andrew Gierth wrote: > > "David" == David Fetter writes: > > David> + return pg_ltostr_zeropad(str, (uint32)0 - (uint32)value, minwidth - > 1); > > No, this is just reintroducing the undefined behavior again. Once the > value has been converted to

Re: Efficient output for integer types

2019-09-23 Thread David Fetter
On Mon, Sep 23, 2019 at 10:28:09AM +0200, Tels wrote: > Moin, > > On 2019-09-22 23:58, David Fetter wrote: > > On Sat, Sep 21, 2019 at 07:29:25AM +0100, Andrew Gierth wrote: > > > > "David" == David Fetter writes: > > > Fixed. > > Good work, more performance is sure nice :) > > Noticed

Re: Efficient output for integer types

2019-09-23 Thread Andrew Gierth
> "David" == David Fetter writes: David> + return pg_ltostr_zeropad(str, (uint32)0 - (uint32)value, minwidth - 1); No, this is just reintroducing the undefined behavior again. Once the value has been converted to unsigned you can't cast it back to signed or pass it to a function expecting

Re: Efficient output for integer types

2019-09-23 Thread Tels
Moin, On 2019-09-22 23:58, David Fetter wrote: On Sat, Sep 21, 2019 at 07:29:25AM +0100, Andrew Gierth wrote: > "David" == David Fetter writes: Fixed. Good work, more performance is sure nice :) Noticed one more thing in the patch: - *start++ = *a; -

Re: Efficient output for integer types

2019-09-22 Thread David Fetter
On Sat, Sep 21, 2019 at 07:29:25AM +0100, Andrew Gierth wrote: > > "David" == David Fetter writes: > > David> +static inline uint32 > David> +decimalLength64(const uint64_t v) > > Should be uint64, not uint64_t. Fixed. > Also return an int, not a uint32. Fixed. > For int vs. int32, my

Re: Efficient output for integer types

2019-09-21 Thread Andrew Gierth
> "David" == David Fetter writes: David> +static inline uint32 David> +decimalLength64(const uint64_t v) Should be uint64, not uint64_t. Also return an int, not a uint32. For int vs. int32, my own inclination is to use "int" where the value is just a (smallish) number, especially one

Re: Efficient output for integer types

2019-09-21 Thread David Fetter
On Sat, Sep 21, 2019 at 03:36:21AM +0100, Andrew Gierth wrote: > > "David" == David Fetter writes: > > David> + /* Compute the result string. */ > David> + if (value >= 1) > David> + { > David> + const uint32 value2 = value % 1; > David> + >

Re: Efficient output for integer types

2019-09-20 Thread Andrew Gierth
> "David" == David Fetter writes: David> + /* Compute the result string. */ David> + if (value >= 1) David> + { David> + const uint32 value2 = value % 1; David> + David> + const uint32 c = value2 % 1; David> +

Re: Efficient output for integer types

2019-09-20 Thread David Fetter
On Fri, Sep 20, 2019 at 11:09:16PM +0200, David Fetter wrote: > On Fri, Sep 20, 2019 at 09:14:51PM +0200, David Fetter wrote: > > On Wed, Sep 18, 2019 at 04:27:46PM +0900, Kyotaro Horiguchi wrote: > > > Hello. > > > > > > At Wed, 18 Sep 2019 05:42:01 +0200, David Fetter wrote > > > in

Re: Efficient output for integer types

2019-09-20 Thread David Fetter
On Fri, Sep 20, 2019 at 09:14:51PM +0200, David Fetter wrote: > On Wed, Sep 18, 2019 at 04:27:46PM +0900, Kyotaro Horiguchi wrote: > > Hello. > > > > At Wed, 18 Sep 2019 05:42:01 +0200, David Fetter wrote > > in <20190918034201.gx31...@fetter.org> > > > On Tue, Sep 17, 2019 at 09:01:57AM +0200,

Re: Efficient output for integer types

2019-09-20 Thread David Fetter
On Wed, Sep 18, 2019 at 04:27:46PM +0900, Kyotaro Horiguchi wrote: > Hello. > > At Wed, 18 Sep 2019 05:42:01 +0200, David Fetter wrote in > <20190918034201.gx31...@fetter.org> > > On Tue, Sep 17, 2019 at 09:01:57AM +0200, David Fetter wrote: > > > On Tue, Sep 17, 2019 at 08:55:05AM +0200, David

Re: Efficient output for integer types

2019-09-18 Thread Kyotaro Horiguchi
Hello. At Wed, 18 Sep 2019 05:42:01 +0200, David Fetter wrote in <20190918034201.gx31...@fetter.org> > On Tue, Sep 17, 2019 at 09:01:57AM +0200, David Fetter wrote: > > On Tue, Sep 17, 2019 at 08:55:05AM +0200, David Fetter wrote: > > > On Sun, Sep 15, 2019 at 09:18:49AM +0200, David Fetter

Re: Efficient output for integer types

2019-09-18 Thread David Fetter
On Wed, Sep 18, 2019 at 07:51:42AM +0200, David Fetter wrote: > On Wed, Sep 18, 2019 at 05:42:01AM +0200, David Fetter wrote: > > On Tue, Sep 17, 2019 at 09:01:57AM +0200, David Fetter wrote: > > > On Tue, Sep 17, 2019 at 08:55:05AM +0200, David Fetter wrote: > > > > On Sun, Sep 15, 2019 at

Re: Efficient output for integer types

2019-09-17 Thread David Fetter
On Wed, Sep 18, 2019 at 05:42:01AM +0200, David Fetter wrote: > On Tue, Sep 17, 2019 at 09:01:57AM +0200, David Fetter wrote: > > On Tue, Sep 17, 2019 at 08:55:05AM +0200, David Fetter wrote: > > > On Sun, Sep 15, 2019 at 09:18:49AM +0200, David Fetter wrote: > > > > Folks, > > > > > > > > Please

Re: Efficient output for integer types

2019-09-17 Thread David Fetter
On Tue, Sep 17, 2019 at 09:01:57AM +0200, David Fetter wrote: > On Tue, Sep 17, 2019 at 08:55:05AM +0200, David Fetter wrote: > > On Sun, Sep 15, 2019 at 09:18:49AM +0200, David Fetter wrote: > > > Folks, > > > > > > Please find attached a couple of patches intended to $subject. > > > > > > This

Re: Efficient output for integer types

2019-09-17 Thread David Fetter
On Tue, Sep 17, 2019 at 08:55:05AM +0200, David Fetter wrote: > On Sun, Sep 15, 2019 at 09:18:49AM +0200, David Fetter wrote: > > Folks, > > > > Please find attached a couple of patches intended to $subject. > > > > This patch set cut the time to copy ten million rows of randomly sized > > int8s

Re: Efficient output for integer types

2019-09-17 Thread David Fetter
On Sun, Sep 15, 2019 at 09:18:49AM +0200, David Fetter wrote: > Folks, > > Please find attached a couple of patches intended to $subject. > > This patch set cut the time to copy ten million rows of randomly sized > int8s (10 of them) by about a third, so at least for that case, it's > pretty

Re: Efficient output for integer types

2019-09-15 Thread David Fetter
On Sun, Sep 15, 2019 at 02:06:29PM +0500, Andrey Borodin wrote: > > 15 сент. 2019 г., в 12:18, David Fetter написал(а): > > > > Please find attached a couple of patches intended to $subject. > > > > This patch set cut the time to copy ten million rows of randomly sized > > int8s (10 of them) by

Re: Efficient output for integer types

2019-09-15 Thread Andrey Borodin
> 15 сент. 2019 г., в 12:18, David Fetter написал(а): > > Please find attached a couple of patches intended to $subject. > > This patch set cut the time to copy ten million rows of randomly sized > int8s (10 of them) by about a third, so at least for that case, it's > pretty decent. Hi!

Efficient output for integer types

2019-09-15 Thread David Fetter
Folks, Please find attached a couple of patches intended to $subject. This patch set cut the time to copy ten million rows of randomly sized int8s (10 of them) by about a third, so at least for that case, it's pretty decent. Thanks to Andrew Gierth for lots of patient help. Best, David. --