Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override HttpRequestDecoder.createMessage() for perfomance #4853

Closed
minwoox opened this issue May 2, 2023 · 5 comments · Fixed by #4863
Closed

Override HttpRequestDecoder.createMessage() for perfomance #4853

minwoox opened this issue May 2, 2023 · 5 comments · Fixed by #4863

Comments

@minwoox
Copy link
Member

minwoox commented May 2, 2023

@ikhoon suggested this:
If we override HttpRequestDecoder.createMessage() and provide our own implementation of HttpMessage, we can covert Netty HTTP 1 headers to Armeria headers with zero-copy.
#3904 (comment)

@echo304
Copy link
Contributor

echo304 commented May 4, 2023

I checked the source code so that I handle this issue but I couldn't find any relevant code like HttpServerCodec, HttpServerRequestDecoder, extending HttpRequestDecoder.
Is this issue still feasible? 🤔

@minwoox
Copy link
Member Author

minwoox commented May 4, 2023

@echo304
Copy link
Contributor

echo304 commented May 4, 2023

So, idea might be like...

  1. Implement ArmeriaHttpRequestDecoder which extends HttpObjectDecoder and override createMessage logic
  2. Implement Armeria's custom HttpServerCodec which extends CombinedChannelDuplexHandler<ArmeriaHttpRequestDecoder, HttpResponseEncoder> and implements HttpServerUpgradeHandler.SourceCodec
  3. Replace here with ArmeriaHttpServerCodec that is implemented above.

Does it make sense to you? 😏
@minwoox

@echo304
Copy link
Contributor

echo304 commented May 6, 2023

Oh, it seems like you already tried to fork netty's HttpServerCodec from here

🤔

@minwoox
Copy link
Member Author

minwoox commented May 7, 2023

Oh, it seems like you already tried to fork netty's HttpServerCodec from here

Yes, I have tried but I reverted it because I didn't have to for my WebSocket PR.
So, please go ahead. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants