On Wed, 19 Jul 2023 at 09:24, Masahiko Sawada <sawada.m...@gmail.com> wrote: > > > > 2) pg_strtoint32_safe() got substantially slower, mainly due > > > to > > > faff8f8e47f Allow underscores in integer and numeric constants. > > > 6fcda9aba83 Non-decimal integer literals > > > > Agreed. > > > I have made some progress on dealing with performance regression on > single client COPY. I've attached a patch to fix 2). With the patch I > shared[1] to deal with 1), single client COPY performance seems to be > now as good as (or slightly better than) PG15 . Here are the results > (averages of 5 times) of loading 50M rows via COPY: >
Hmm, I'm somewhat sceptical about this second patch. It's not obvious why adding such tests would speed it up, and indeed, testing on my machine with 50M rows, I see a noticeable speed-up from patch 1, and a slow-down from patch 2: PG15 ==== 7390.461 ms 7497.655 ms 7485.850 ms 7406.336 ms HEAD ==== 8388.707 ms 8283.484 ms 8391.638 ms 8363.306 ms HEAD + P1 ========= 7255.128 ms 7185.319 ms 7197.822 ms 7191.176 ms HEAD + P2 ========= 8687.164 ms 8654.907 ms 8641.493 ms 8668.865 ms HEAD + P1 + P2 ============== 7780.126 ms 7786.427 ms 7775.047 ms 7785.938 ms So for me at least, just applying patch 1 gives the best results, and makes it slightly faster than PG15 (possibly due to 6b423ec677). Regards, Dean