Skip to content

perf(java): bind ipc debug log to config, use sonic for protocol json#193

Merged
wzekin merged 1 commit into
mainfrom
perf/java-ipc-debug-and-sonic
May 14, 2026
Merged

perf(java): bind ipc debug log to config, use sonic for protocol json#193
wzekin merged 1 commit into
mainfrom
perf/java-ipc-debug-and-sonic

Conversation

@wzekin
Copy link
Copy Markdown
Collaborator

@wzekin wzekin commented May 14, 2026

What type of PR is this?

perf

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
The Java IPC protocol unconditionally enabled debug logging on the
reader and writer, causing each of the ~2.5k messages per parse to
trigger a full JSON dump to stderr. Bind SetDebug to the existing
JavaParserServer config so debug output is off by default.

Switch the protocol layer to sonic for the four Unmarshal sites and
one Marshal site. encoding/json was the dominant cost on the Go side
(38% of CPU, 2s of unmarshal time on a 2k-class repo); sonic cuts the
ReadMessage path by ~75%.

Combined effect on travel-business (2153 java files):
wall 61.0s -> 53.4s (-12.5%)
user 6:37 -> 5:30
Go CPU 8.48% -> 5.83%
zh(optional):

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

The Java IPC protocol unconditionally enabled debug logging on the
reader and writer, causing each of the ~2.5k messages per parse to
trigger a full JSON dump to stderr. Bind SetDebug to the existing
JavaParserServer config so debug output is off by default.

Switch the protocol layer to sonic for the four Unmarshal sites and
one Marshal site. encoding/json was the dominant cost on the Go side
(38% of CPU, 2s of unmarshal time on a 2k-class repo); sonic cuts the
ReadMessage path by ~75%.

Combined effect on travel-business (2153 java files):
  wall   61.0s -> 53.4s  (-12.5%)
  user   6:37  -> 5:30
  Go CPU 8.48% -> 5.83%
@wzekin wzekin force-pushed the perf/java-ipc-debug-and-sonic branch from 20bcf81 to f003066 Compare May 14, 2026 12:52
@wzekin wzekin merged commit 5a22592 into main May 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants