Skip to content

Conversation

@e5l
Copy link
Member

@e5l e5l commented Jan 31, 2026

Optimizations applied:

  • Skip redundant job cancellation in NettyApplicationCall
  • Lazy routing trace registration (only when TRACE logging enabled)
  • CaseInsensitiveMap: open-addressing hash table (eliminates CaseInsensitiveString allocations)
  • HttpProtocolVersion.parse: fast path for HTTP/1.0, HTTP/1.1, HTTP/2.0, HTTP/3.0
  • StringValuesImpl: parallel arrays for zero-allocation forEach
  • GMTDate: zero-allocation timestamp conversion using civil_from_days algorithm
  • LazyThreadSafetyMode.NONE for request-scoped lazy properties

Results (256 byte payload, 64 concurrency):

  • Download: 22,713 req/s, 5.55 MB/s
  • Upload: 23,529 req/s, 5.74 MB/s
  • GC overhead: reduced from ~10.5% to 0.70%

Added throughput benchmark module with:

  • Request/response throughput benchmarks
  • Big file transfer benchmark (achieved 10.66 Gbps with LocalFileContent, 18.48 Gbps with in-memory)
  • async-profiler integration scripts

Optimizations applied:
- Skip redundant job cancellation in NettyApplicationCall
- Lazy routing trace registration (only when TRACE logging enabled)
- CaseInsensitiveMap: open-addressing hash table (eliminates CaseInsensitiveString allocations)
- HttpProtocolVersion.parse: fast path for HTTP/1.0, HTTP/1.1, HTTP/2.0, HTTP/3.0
- StringValuesImpl: parallel arrays for zero-allocation forEach
- GMTDate: zero-allocation timestamp conversion using civil_from_days algorithm
- LazyThreadSafetyMode.NONE for request-scoped lazy properties

Results (256 byte payload, 64 concurrency):
- Download: 22,713 req/s, 5.55 MB/s
- Upload: 23,529 req/s, 5.74 MB/s
- GC overhead: reduced from ~10.5% to 0.70%

Added throughput benchmark module with:
- Request/response throughput benchmarks
- Big file transfer benchmark (achieved 10.66 Gbps with LocalFileContent, 18.48 Gbps with in-memory)
- async-profiler integration scripts

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch e5l/opt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@e5l e5l changed the title Server throughput optimizations: reduce GC overhead by ~93% Server throughput optimizations: reduce GC overhead Feb 1, 2026
e5l and others added 2 commits February 1, 2026 09:25
When entries are removed and re-added to the map (e.g., in DefaultRequest
header merging), the insertionOrder array would contain duplicate indices
pointing to the same slot. This caused StringValuesImpl to throw
ArrayIndexOutOfBoundsException when iterating.

Fix:
- Invalidate insertionOrder entry when removing a key
- Update insertionOrder entries to new indices when rehashing displaced entries
- Add putWithoutTrackingOrderReturnIndex() helper for rehash operations
- Restore protected 'values' property in StringValuesImpl for ABI compatibility

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants