Re: Improving and extending int128.h to more of numeric.c
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: John Naylor <johncnaylorls@gmail.com>
Cc: Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-07-14T21:07:38Z
Lists: pgsql-hackers
Attachments
- v4-0001-Convert-src-tools-testint128.c-into-a-test-module.patch (text/x-patch) patch v4-0001
- v4-0004-Simplify-non-native-64x64-bit-multiplication-in-i.patch (text/x-patch) patch v4-0004
- v4-0005-Extend-int128.h-to-support-more-numeric-code.patch (text/x-patch) patch v4-0005
- v4-0003-Optimise-non-native-128-bit-addition-in-int128.h.patch (text/x-patch) patch v4-0003
- v4-0002-Refactor-int128.h-bringing-the-native-and-non-nat.patch (text/x-patch) patch v4-0002
On Mon, 14 Jul 2025 at 11:22, John Naylor <johncnaylorls@gmail.com> wrote:
>
> (Looking at v3) The new test module runs 10 million rather than a
> billion iterations. That still takes 1.2s (after 0005), which seems
> excessive for regular buildfarm testing. It seems like we could get by
> with fewer than that, by using the time of day for the PRNG seed
> (which would also need to be logged on error).
Thanks for looking!
I have reduced the number of iterations and changed it to use the
current time for the PRNG seed. I don't see much value in logging the
seed though, since we already log the inputs that cause any failure.
> > 0005 is the main patch.
> >
> I haven't looked too closely, but wanted to point out:
>
> warning: format ‘%lX’ expects argument of type ‘long unsigned int’,
> but argument 4 has type ‘int32’ {aka ‘int’} [-Wformat=]
>
> ...
Ah yes, thanks for pointing that out.
(The cfbot reports the same warnings, but you have to scroll through a
lot of output to see them. It would be nice if the commitfest app had
an indicator to show if there were any compiler warnings.)
v4 attached.
Regards,
Dean
Commits
-
Guard against division by zero in test_int128 module.
- 7e2af1fb1118 19 (unreleased) landed
-
Extend int128.h to support more numeric code.
- d699687b329e 19 (unreleased) landed
-
Simplify non-native 64x64-bit multiplication in int128.h.
- d8a08dbee46c 19 (unreleased) landed
-
Optimise non-native 128-bit addition in int128.h.
- d9bb8ef093d6 19 (unreleased) landed
-
Refactor int128.h, bringing the native and non-native code together.
- 5761d991c984 19 (unreleased) landed
-
Convert src/tools/testint128.c into a test module.
- 8c7445a00810 19 (unreleased) landed