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

perf: remove headers inline #22

Merged
merged 2 commits into from
Apr 13, 2022
Merged

perf: remove headers inline #22

merged 2 commits into from
Apr 13, 2022

Conversation

somehowchris
Copy link
Contributor

Well cloing all headers isn't really a huge overhead but again I see it as a performance loss as a) mem neads to be allocated as you clone and insert and b) cycles are spent to iterate over all headers which all iterate over the HOP_HEADERS array.

So I know, duplicated code should be eliminated but in case of this I couldn't find another solution and looking at it, 2 times 3 lines of code really aint that much.

@somehowchris
Copy link
Contributor Author

@somehowchris
Copy link
Contributor Author

Also added the Proxy-Connection Header to the hop_header list https://cs.opensource.google/go/go/+/refs/tags/go1.18.1:src/net/http/httputil/reverseproxy.go;l=178

@felipenoris felipenoris merged commit cb3127c into felipenoris:master Apr 13, 2022
@somehowchris somehowchris deleted the feature/header-removal branch April 13, 2022 23:13
@chesedo chesedo mentioned this pull request May 4, 2022
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