Re: Some optimisations for numeric division

2022-02-27 Thread Dean Rasheed
On Fri, 25 Feb 2022 at 18:30, Tom Lane wrote: > > Dean Rasheed writes: > > And another update following feedback from the cfbot. > > This patchset LGTM. On my machine there doesn't seem to be any > measurable performance change for the numeric regression test, > but numeric_big gets about 15% fa

Re: Some optimisations for numeric division

2022-02-25 Thread Tom Lane
Dean Rasheed writes: > And another update following feedback from the cfbot. This patchset LGTM. On my machine there doesn't seem to be any measurable performance change for the numeric regression test, but numeric_big gets about 15% faster. The only additional thought I have, based on your com

Re: Some optimisations for numeric division

2022-02-25 Thread Dean Rasheed
On Fri, 25 Feb 2022 at 10:45, Dean Rasheed wrote: > > Attached is the updated patch series (0001 and 0002 unchanged). > And another update following feedback from the cfbot. Regards, Dean From 41732ad9a44dcd12e52d823fb59cb23cce4fe217 Mon Sep 17 00:00:00 2001 From: Dean Rasheed Date: Sun, 20 Feb

Re: Some optimisations for numeric division

2022-02-25 Thread Dean Rasheed
On Wed, 23 Feb 2022 at 22:55, Tom Lane wrote: > > Dean Rasheed writes: > > > One thought that occurred to me was that it's a bit silly that > > exp_var() and ln_var() have to use a NumericVar for what could just be > > an int, if we had a div_var_int() function that could divide by an > > int. Th

Re: Some optimisations for numeric division

2022-02-23 Thread Tom Lane
Dean Rasheed writes: > On Wed, 23 Feb 2022 at 20:55, Tom Lane wrote: >> I'm +1 on 0001 and 0002, but 0003 feels >> a bit ad-hoc. It certainly *looks* weird for the allegedly faster >> function to be handing off to the allegedly slower one. I also wonder >> if we're leaving anything on the table

Re: Some optimisations for numeric division

2022-02-23 Thread Dean Rasheed
On Wed, 23 Feb 2022 at 20:55, Tom Lane wrote: > > I took a quick look through these (just eyeball, didn't try to verify > your performance statements). Thanks for looking! > I'm +1 on 0001 and 0002, but 0003 feels > a bit ad-hoc. It certainly *looks* weird for the allegedly faster > function t

Re: Some optimisations for numeric division

2022-02-23 Thread Tom Lane
Dean Rasheed writes: > Attached are 3 small patches that improve the performance of numeric > division. Patch 0002 seems to have the biggest impact, but I think > they're all worth including, since they're quite simple changes, with > noticeable performance gains. I took a quick look through thes

Some optimisations for numeric division

2022-02-23 Thread Dean Rasheed
Attached are 3 small patches that improve the performance of numeric division. Patch 0002 seems to have the biggest impact, but I think they're all worth including, since they're quite simple changes, with noticeable performance gains. Patch 0001 vectorises the inner loop of div_var_fast(). This