HotSpot[ByteStream]: Split ByteStream into Reader and Writer
- Dominant language
- Java
- Stars
- 203
- Forks
- 104
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
ByteStream is currently used for two fundamentally different purposes:
(1) a write-oriented, growable buffer optimized for encoding and frequent small writes, and
(2) a read-only wrapper over an existing buffer via wrap_from().
These two usages have very different requirements, but are implemented in a single class.
This mixed design complicates the implementation and blocks write-side optimizations such as fixed (power-of-two) page sizes and compile-time specialization, while also forcing the read path to carry unnecessary paging and write-related state. Splitting ByteStream into explicit Reader and Writer types clarifies responsibilities, simplifies invariants, and enables better performance and maintainability.
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate ByteStream and its wrap_from() entry point first, then map the read-oriented and write-oriented callers. Clarify the design and migration boundaries before changing code. Done means explicit Reader and Writer types replace the mixed class while retaining the two responsibilities described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100