Re: test_json_parser/002_inline is kind of slow - Mailing list pgsql-hackers

From Tom Lane
Subject Re: test_json_parser/002_inline is kind of slow
Date
Msg-id 4082719.1758902505@sss.pgh.pa.us
Whole thread Raw
In response to Re: test_json_parser/002_inline is kind of slow  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Sep 26, 2025 at 11:33 AM Jacob Champion
> <jacob.champion@enterprisedb.com> wrote:
>> Agreed, it's pretty inefficient. (For comparison, it runs in about two
>> seconds on my machine, so I hadn't noticed how bad it had gotten.
>> Thanks for pointing it out.)

> Interesting. Are you on Linux? I'm testing directly on macOS, and I
> wonder now whether macOS is comparatively slower at starting new
> processes...

Something else going on, perhaps?  With PROVE_FLAGS=--timer,
I see this on my RHEL8 workstation:

[11:55:32] t/001_test_json_parser_incremental.pl .. ok      475 ms ( 0.02 usr  0.00 sys +  0.26 cusr  0.25 csys =  0.53
CPU)
[11:55:32] t/002_inline.pl ........................ ok     2883 ms ( 0.11 usr  0.01 sys +  1.40 cusr  1.70 csys =  3.22
CPU)
[11:55:35] t/003_test_semantic.pl ................. ok       70 ms ( 0.00 usr  0.00 sys +  0.06 cusr  0.02 csys =  0.08
CPU)
[11:55:35] t/004_test_parser_perf.pl .............. ok       57 ms ( 0.00 usr  0.00 sys +  0.05 cusr  0.00 csys =  0.05
CPU)
[11:55:35]
All tests successful.
Files=4, Tests=3930,  3 wallclock secs ( 0.14 usr  0.01 sys +  1.77 cusr  1.97 csys =  3.89 CPU)
Result: PASS

and this on my MacBook Pro M4 (Sequoia 15.6.1):

[11:56:06] t/001_test_json_parser_incremental.pl .. ok      571 ms ( 0.01 usr  0.00 sys +  0.24 cusr  0.28 csys =  0.53
CPU)
[11:56:06] t/002_inline.pl ........................ ok     3544 ms ( 0.06 usr  0.02 sys +  1.43 cusr  1.86 csys =  3.37
CPU)
[11:56:10] t/003_test_semantic.pl ................. ok       54 ms ( 0.00 usr  0.00 sys +  0.03 cusr  0.02 csys =  0.05
CPU)
[11:56:10] t/004_test_parser_perf.pl .............. ok       39 ms ( 0.00 usr  0.00 sys +  0.03 cusr  0.01 csys =  0.04
CPU)
[11:56:10]
All tests successful.
Files=4, Tests=3930,  4 wallclock secs ( 0.08 usr  0.02 sys +  1.73 cusr  2.17 csys =  4.00 CPU)
Result: PASS

The M4 is about 2.3x the speed of the workstation according to
geekbench, so macOS is not covering itself with glory here,
but it's sure not 10x worse than Linux.  Maybe you've got a
Perl installation with debugging turned on, or something?

Having said that, even three-ish seconds is an annoying
contribution to check-world, so let's see if there's not some
low-hanging fruit here.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: test_json_parser/002_inline is kind of slow
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] GROUP BY ALL