Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)compiler(dot)org>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize numeric multiplication for one and two base-NBASE digit multiplicands.
Date: 2024-07-03 12:22:35
Message-ID: CA+TgmoYHLPXQOQZUjfqoLGzYL9hn_Z3zodp8OnmM6qKG0raueA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 1, 2024 at 6:19 PM Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> Repeating your benchmark where both numbers have up to 2 NBASE-digits,
> this new approach was slightly faster:
>
> SELECT SUM(num1*num2) FROM bench_mul_var; -- HEAD
> Time: 4762.990 ms (00:04.763)
> Time: 4332.166 ms (00:04.332)
> Time: 4276.211 ms (00:04.276)
> Time: 4247.321 ms (00:04.247)
> Time: 4166.738 ms (00:04.167)
>
> SELECT SUM(num1*num2) FROM bench_mul_var; -- v2 patch
> Time: 4398.812 ms (00:04.399)
> Time: 3672.668 ms (00:03.673)
> Time: 3650.227 ms (00:03.650)
> Time: 3611.420 ms (00:03.611)
> Time: 3534.218 ms (00:03.534)
>
> SELECT SUM(num1*num2) FROM bench_mul_var; -- this patch
> Time: 3350.596 ms (00:03.351)
> Time: 3336.224 ms (00:03.336)
> Time: 3335.599 ms (00:03.336)
> Time: 3336.990 ms (00:03.337)
> Time: 3351.453 ms (00:03.351)

I don't have any particular technical insight on this topic, but I
just want to mention that I'm excited about the work. Numeric
performance can be painfully slow, and these seem like quite
significant speedups that will affect lots of real-world cases.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-07-03 13:01:16 Re: On disable_cost
Previous Message Dilip Kumar 2024-07-03 11:52:55 Re: Conflict Detection and Resolution