[PR #1239] [CLOSED] Optimize getFilteredByACLPeers #1981

Closed
opened 2025-12-29 03:19:08 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/1239
Author: @QZAiXH
Created: 2/28/2023
Status: Closed

Base: mainHead: optimize_getFilteredByACLPeers


📝 Commits (1)

  • 88b1d4f Use map instead of for to speed up the lookup

📊 Changes

4 files changed (+112 additions, -50 deletions)

View changed files

📝 acls.go (+20 -0)
📝 app.go (+5 -3)
📝 machine.go (+64 -44)
📝 machine_test.go (+23 -3)

📄 Description

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

Use map to speed up lookups. This can effectively reduce cpu 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/juanfont/headscale/pull/1239 **Author:** [@QZAiXH](https://github.com/QZAiXH) **Created:** 2/28/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `optimize_getFilteredByACLPeers` --- ### 📝 Commits (1) - [`88b1d4f`](https://github.com/juanfont/headscale/commit/88b1d4fdd869bd9eb1295188837a5afcf06864fa) Use map instead of for to speed up the lookup ### 📊 Changes **4 files changed** (+112 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `acls.go` (+20 -0) 📝 `app.go` (+5 -3) 📝 `machine.go` (+64 -44) 📝 `machine_test.go` (+23 -3) </details> ### 📄 Description <!-- Please tick if the following things apply. You… --> - [x] read the [CONTRIBUTING guidelines](README.md#contributing) - [ ] raised a GitHub issue or discussed it on the projects chat beforehand - [ ] added unit tests - [ ] added integration tests - [ ] updated documentation if needed - [ ] updated CHANGELOG.md <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> Use map to speed up lookups. This can effectively reduce cpu usage --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:19:08 +01:00
adam closed this issue 2025-12-29 03:19:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1981