kitlangton / kitlangton/zio-api
Use `unsafeEncode` for parsing requests
- Dominant language
- Scala
- Stars
- 24
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
I think we can make `RequestParser` much faster by not parsing `zhttp.http.Request` instead using `io.netty.handler.codec.http.HttpRequest`. You can access it via `unsafeEncode` method on `Request`.
This will dramatically improve performance, because -
1. For each real request parsing is done over `HttpRequest` which can reduce the overall number of allocations.
2. We can internally optimize the server to not create new `Request` at all when we are using this API :)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating RequestParser and the Request API, then read how unsafeEncode exposes the underlying HttpRequest. Trace the existing request-parsing path and its tests, if present; done means parsing uses the intended Netty request representation without changing request behavior and demonstrates the claimed allocation or performance improvement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100