Re: WIP Incremental JSON Parser
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Jacob Champion <jacob.champion@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, Nathan Bossart <nathandbossart@gmail.com>, Jelte Fennema-Nio <postgres@jeltef.nl>, Amit Langote <amitlangote09@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Peter Smith <smithpb2250@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-18T06:04:41Z
Lists: pgsql-hackers
On Wed, Apr 10, 2024 at 07:47:38AM -0400, Andrew Dunstan wrote:
> Here's v2 of the cleanup patch 4, that fixes some more typos kindly pointed
> out to me by Alexander Lakhin.
I can see that this has been applied as of 42fa4b660143 with some
extra commits.
Anyway, I have noticed another thing in the surroundings that's
annoying. 003 has this logic:
use File::Temp qw(tempfile);
[...]
my ($fh, $fname) = tempfile();
print $fh $stdout,"\n";
close($fh);
This creates a temporary file in /tmp/ that remains around, slowing
bloating the temporary file space on a node while leaving around some
data. Why using File::Temp::tempfile here? Couldn't you just use a
file in a PostgreSQL::Test::Utils::tempdir() that would be cleaned up
once the test finishes?
Per [1], escape_json() has no coverage outside its default path. Is
that intended?
Documenting all these test files with a few comments would be welcome,
as well, with some copyright notices...
json_file = fopen(testfile, "r");
fstat(fileno(json_file), &statbuf);
bytes_left = statbuf.st_size;
No checks on failure of fstat() here?
json_file = fopen(argv[2], "r");
Second one in test_json_parser_perf.c, with more stuff for fread().
[1]: https://coverage.postgresql.org/src/test/modules/test_json_parser/test_json_parser_incremental.c.gcov.html
--
Michael
Commits
-
Post review fixes for test_json_parser test module
- ba3e6e2bca97 17.0 landed
-
Shrink test file for test_json_parser module
- b8a7bfa33324 17.0 landed
-
Add support for incrementally parsing backup manifests
- ea7b4e9a2a7c 17.0 landed
-
Introduce a non-recursive JSON parser
- 3311ea86edc7 17.0 landed
-
Use incremental parsing of backup manifests.
- 222e11a10ae9 17.0 landed