Message-ID: From: "dfa1 (@dfa1)" To: "pgjdbc/pgjdbc" Date: Sun, 10 May 2026 06:01:48 +0000 Subject: [pgjdbc/pgjdbc] PR #4063: fix: getCharacterStream wraps String in StringReader List-Id: X-GitHub-Author-Id: 5798698 X-GitHub-Author-Login: dfa1 X-GitHub-Issue: 4063 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4063 Content-Type: text/plain; charset=utf-8 Previously returned new CharArrayReader(value.toCharArray()), which allocates a char[] proportional to the string length (2 * n bytes). StringReader wraps the String directly with no extra allocation. No benchmark written: the allocation is trivially O(n) and the fix is mechanical. Visible in -prof gc as reduced char[] allocation under any workload that calls getCharacterStream().