modelcontextprotocol / modelcontextprotocol/java-sdk
Optimization - avoid unnecessary payload copy when deserializing
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.1k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 9
Description
This issue suggests creating a JSON deserialization variant that consumes an InputStream without the need for a String copy of the HTTP request payload, reducing the GC pressure and improving overall performance.
Expected Behavior
Efficient correct HTTP
bad user data should return 400
Current Behavior
Bad data returns 5xx
Extrac copies of JSON messages are created in memory
Context
More memory pressure,
harder to debug
(edit by @chemicL)
The PR addressing this is #157
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing PR #157, which the issue identifies as addressing this work, and trace the HTTP deserialization entry point it changes. Done means supporting InputStream-based deserialization without unnecessary String copies and returning 400 for bad user data instead of 5xx; verify the relevant behavior with the PR's tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100