Re: Optimize mul_var() for var1ndigits >= 8

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimize mul_var() for var1ndigits >= 8
Date: 2024-07-29 21:59:57
Message-ID: CAEZATCUZy3Qk9hQNXVF2UacV==UFjbjUyJgeKrV70M52QgocpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 29 Jul 2024 at 21:39, Joel Jacobson <joel(at)compiler(dot)org> wrote:
>
> I like these simplifications, how `var2ndigits` is used instead of `res_ndigits`:
> - for (int i = res_ndigits - 3; i >= 1; i--)
> + for (int i = var2ndigits - 1; i >= 1; i--)
>
> But I wonder why does `case 1:` not follow the same pattern?
> for (int i = res_ndigits - 2; i >= 0; i--)
>

Ah yes, that should be made the same. (I think I did do that at one
point, but then accidentally reverted it during a code refactoring.)

> * v3-0002
>
> I think it's non-obvious if the separate code paths for 32-bit and 64-bit,
> using `#if SIZEOF_DATUM < 8`, to get *fast* 32-bit support, outweighs
> the benefits of simpler code.
>
> You brought up the question if 32-bit systems should be regarded
> as legacy previously in this thread.
>
> Unfortunately, we didn't get any feedback, so I'm starting a separate
> thread, with subject "Is fast 32-bit code still important?", hoping to get
> more input to help us make judgement calls.
>

Looking at that other thread that you found [1], I think it's entirely
possible that there are people who care about 32-bit systems, which
means that we might well get complaints, if we make it slower for
them. Unfortunately, I don't have any way to test that (I doubt that
running a 32-bit executable on my x86-64 system is a realistic test).

Regards,
Dean

[1] https://postgr.es/m/0a71b43129fb447988f152941e1dbcb3@nidsa.net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-07-29 22:14:10 Speeding up ruleutils' name de-duplication code, redux
Previous Message Thomas Munro 2024-07-29 21:50:08 Re: Remove last traces of HPPA support