perf: Optimize writeIntegerList
- Dominant language
- Java
- Stars
- 44
- Forks
- 15
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 12
Description
Replaces the two-pass (compute size, then write) approach with single-pass type-specific writers that reserve placeholder space for the length prefix and patch it in afterward, falling back to two-pass only for very large lists. Output bytes unchanged.
**Benefit:** cuts a full extra pass over packed integer lists on the write path — same wire format, fewer CPU cycles.
PR: hashgraph/pbj#917
Contributor guide
Research direction
Start at the writeIntegerList implementation and inspect PR hashgraph/pbj#917, which contains the proposed optimization. Verify that the single-pass writers preserve the existing wire-format bytes and that the fallback for very large lists remains covered by the change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100