model-writtenrun 4746 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut proposed replacing explicit literal lengths with appendStringInfoString in JSONB and JSONPath output, alongside changing appendBinaryStringInfo and its NT variant to accept const void * and eliminate caller casts #1.
- Andres Freund warned that added strlen calls could hurt JSONB output and proposed inlining; David Rowley explored a constant-detection macro and binary-size costs, while Tom Lane explained why passing an additional length argument could increase code size #2 #3 #4.
- Peter Eisentraut and Tom Lane questioned whether JSONPath output needed such optimization, while David Rowley distinguished the performance-sensitive JSONB changes; Andrew Dunstan supported JSONPath cleanup and the void * change, and Robert Haas agreed that the existing JSONB literal lengths were acceptable #5 #7 #8 #9 #12.
- David Rowley's benchmarks found the proposed JSONB cleanup about 1% slower and an inline appendStringInfoString experiment about 4.4% faster on a separate workload, providing evidence for preserving the existing JSONB calls #13.
- The performance discussion also explored broader inlining, appendStringInfoSpaces, character appends in escape_json, and an ASCII fast path in pg_mbstrlen_with_len; David Rowley and John Naylor reported gains from the latter experiments, but none of these optimizations entered the submitted series #10 #11 #14 #15 #16.
- Peter Eisentraut revised the series to omit JSONB changes while retaining the JSONPath cleanup and binary argument changes, explaining that forthcoming JSONPath work would benefit from a more robust coding style #17.
- David Rowley suggested a separately named inline function as another way to avoid performance regressions, while acknowledging the binary-size cost of inlining the existing function everywhere #18.
- Peter Eisentraut committed both revised patches unchanged apart from rebase context as 33a33f0ba4 and 1f605b82ba, announced completion, and explained that broader optimization was unnecessary for this cleanup #17 #19 #20.
- In February, Peter Eisentraut submitted a separate follow-up applying the const void * argument convention to pq_sendbytes, a wrapper around appendBinaryStringInfo, and removing further caller casts #21.
- Corey Huinker endorsed the follow-up and reported a successful make check-world run; Peter Eisentraut committed it unchanged as 3b12e68a5c and confirmed completion, leaving all retained submitted work landed and the JSONB cleanup excluded #22 #23.