From: | "Joel Jacobson" <joel(at)compiler(dot)org> |
---|---|
To: | "Dean Rasheed" <dean(dot)a(dot)rasheed(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Optimising numeric division |
Date: | 2024-08-24 07:26:02 |
Message-ID: | 5647a066-3390-437b-ae28-fbe4a7d0e6d6@app.fastmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, Aug 24, 2024, at 01:35, Joel Jacobson wrote:
> On Sat, Aug 24, 2024, at 00:00, Joel Jacobson wrote:
>> Since statistical tools that rely on normal distributions can't be used,
>> let's look at the individual measurements for (var1ndigits=3, var2ndigits=3)
>> since that seems to be the biggest slowdown on both CPUs,
>> and see if our level of surprise is affected.
>
> Here is a more traditional benchmark,
> which seems to also indicate (var1ndigits=3, var2ndigits=3) is a bit slower:
I tested just adding back div_var_int64, and it seems to help.
-- Intel Core i9-14900K:
select summary, x var1ndigits,y var2ndigits,a_avg,b_avg,pooled_stddev,abs_diff,rel_diff,sigmas from catbench.vreport where function_name = 'numeric_div' and summary like 'Add back div_var_int64%' and sigmas > 1 order by x,y;
summary | var1ndigits | var2ndigits | a_avg | b_avg | pooled_stddev | abs_diff | rel_diff | sigmas
--------------------------+-------------+-------------+--------+--------+---------------+----------+----------+--------
Add back div_var_int64. | 1 | 3 | 120 ns | 85 ns | 11 ns | -40 ns | -32 | 4
Add back div_var_int64. | 1 | 4 | 120 ns | 97 ns | 11 ns | -28 ns | -23 | 3
Add back div_var_int64. | 2 | 3 | 120 ns | 89 ns | 11 ns | -29 ns | -25 | 3
Add back div_var_int64. | 2 | 4 | 130 ns | 94 ns | 14 ns | -32 ns | -25 | 2
Add back div_var_int64. | 3 | 3 | 130 ns | 85 ns | 11 ns | -41 ns | -32 | 4
Add back div_var_int64. | 3 | 4 | 130 ns | 99 ns | 13 ns | -29 ns | -23 | 2
Add back div_var_int64. | 4 | 4 | 130 ns | 100 ns | 12 ns | -28 ns | -22 | 2
(7 rows)
Regards,
Joel
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2024-08-24 08:42:53 | thread-safety: getpwuid_r() |
Previous Message | Jubilee Young | 2024-08-24 04:55:43 | Re: [PATCH] Guard `CLOBBER_FREED_MEMORY` & `MEMORY_CONTEXT_CHECKING` |