[PR #64] perf(proxy): Optimize lock usage in proxy connection handling #246

Open
opened 2026-04-27 18:11:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/gerbil/pull/64
Author: @LaurenceJJones
Created: 3/13/2026
Status: 🔄 Open

Base: devHead: proxy-lock-perf-improvements


📝 Commits (1)

  • 14a3e7c Optimize lock usage in proxy connection handling

📊 Changes

1 file changed (+24 additions, -21 deletions)

View changed files

📝 proxy/proxy.go (+24 -21)

📄 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

  • Change activeTunnel.conns from slice to map for O(1) add/remove
  • Improve lock scoping in UpdateLocalSNIs: use read lock for diff computation, minimize write lock hold time
  • Move cache invalidation outside lock (go-cache is thread-safe)

How to test?

Internal proxy usage.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/gerbil/pull/64 **Author:** [@LaurenceJJones](https://github.com/LaurenceJJones) **Created:** 3/13/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `proxy-lock-perf-improvements` --- ### 📝 Commits (1) - [`14a3e7c`](https://github.com/fosrl/gerbil/commit/14a3e7c5318bdd4cd34a9d813119fc1058654187) Optimize lock usage in proxy connection handling ### 📊 Changes **1 file changed** (+24 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `proxy/proxy.go` (+24 -21) </details> ### 📄 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 - Change activeTunnel.conns from slice to map for O(1) add/remove - Improve lock scoping in UpdateLocalSNIs: use read lock for diff computation, minimize write lock hold time - Move cache invalidation outside lock (go-cache is thread-safe) ## How to test? Internal proxy usage. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-27 18:11:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gerbil#246