mirror of
https://github.com/fosrl/gerbil.git
synced 2026-05-08 20:07:49 -05:00
[PR #75] perf: optimize SNI ClientHello parsing #257
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/gerbil/pull/75
Author: @LaurenceJJones
Created: 4/9/2026
Status: 🔄 Open
Base:
dev← Head:investigate/sni-cpu-upstream-dev📝 Commits (1)
3377bc6optimize SNI ClientHello parsing + add regression coverage📊 Changes
2 files changed (+614 additions, -41 deletions)
View changed files
📝
proxy/proxy.go(+146 -41)📝
proxy/proxy_test.go(+468 -0)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Move SNI extraction from TLS handshake to direct ClientHello parsing. Keeps forwarding behavior and hostname normalization compatibility. Adds parity + malformed-input tests and broader fixture benchmarks.
Benchmark summary (linux/amd64, i7-12700H)
Overall: ~16x-19x faster, ~85% fewer allocs/op.
How to test?
Internal SNI forwarding but ensured correctives within testing suite and performed benchmark tests to ensure it drives improvement.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.