[PR #277] [MERGED] perf(proxy): add sync.Pool for UDP buffers #724

Closed
opened 2026-04-16 03:40:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/newt/pull/277
Author: @LaurenceJJones
Created: 3/16/2026
Status: Merged
Merged: 4/9/2026
Merged by: @oschwartz10612

Base: devHead: refactor/proxy-udp-buffer-pool


📝 Commits (1)

  • 4d8d002 perf(proxy): add sync.Pool for UDP buffers

📊 Changes

1 file changed (+29 additions, -3 deletions)

View changed files

📝 proxy/manager.go (+29 -3)

📄 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

  • Add udpBufferPool for reusable 65507-byte UDP packet buffers
  • Add getUDPBuffer() and putUDPBuffer() helper functions
  • Clear buffer contents before returning to pool to prevent data leakage
  • Apply pooling to both main handler buffer and per-client goroutine buffers
  • Reduces GC pressure from frequent large allocations during UDP proxying

How to test?

Internal code changes.


🔄 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/newt/pull/277 **Author:** [@LaurenceJJones](https://github.com/LaurenceJJones) **Created:** 3/16/2026 **Status:** ✅ Merged **Merged:** 4/9/2026 **Merged by:** [@oschwartz10612](https://github.com/oschwartz10612) **Base:** `dev` ← **Head:** `refactor/proxy-udp-buffer-pool` --- ### 📝 Commits (1) - [`4d8d002`](https://github.com/fosrl/newt/commit/4d8d00241de07fadf05b052d2fe89759f1ef811d) perf(proxy): add sync.Pool for UDP buffers ### 📊 Changes **1 file changed** (+29 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `proxy/manager.go` (+29 -3) </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 - Add udpBufferPool for reusable 65507-byte UDP packet buffers - Add getUDPBuffer() and putUDPBuffer() helper functions - Clear buffer contents before returning to pool to prevent data leakage - Apply pooling to both main handler buffer and per-client goroutine buffers - Reduces GC pressure from frequent large allocations during UDP proxying ## How to test? Internal code changes. --- <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-16 03:40:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/newt#724