[PR #3254] [MERGED] optimize: GetAuthKey #4711

Closed
opened 2026-05-05 14:47:16 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/3254
Author: @fakeboboliu
Created: 1/13/2023
Status: Merged
Merged: 1/14/2023
Merged by: @fatedier

Base: devHead: dev


📝 Commits (1)

📊 Changes

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

View changed files

📝 pkg/util/util/util.go (+1 -1)

📄 Description

could be ~30% faster, it's a hot function that deserves an optimization

goos: windows
goarch: amd64
pkg: github.com/fatedier/frp/pkg/util/util
cpu: AMD Ryzen 9 5950X 16-Core Processor
BenchmarkGetAuthKey
BenchmarkGetAuthKey-32           6673195               179.0 ns/op            96 B/op          4 allocs/op
BenchmarkGetAuthKeyOld
BenchmarkGetAuthKeyOld-32        4884744               244.7 ns/op           128 B/op          6 allocs/op

Use this patch for benchmark: patch.txt


🔄 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/fatedier/frp/pull/3254 **Author:** [@fakeboboliu](https://github.com/fakeboboliu) **Created:** 1/13/2023 **Status:** ✅ Merged **Merged:** 1/14/2023 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`4a5be84`](https://github.com/fatedier/frp/commit/4a5be8410426dc0ca4bb6ed1b6db5812a030ac7d) optimize: GetAuthKey ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `pkg/util/util/util.go` (+1 -1) </details> ### 📄 Description could be ~30% faster, it's a hot function that deserves an optimization ``` goos: windows goarch: amd64 pkg: github.com/fatedier/frp/pkg/util/util cpu: AMD Ryzen 9 5950X 16-Core Processor BenchmarkGetAuthKey BenchmarkGetAuthKey-32 6673195 179.0 ns/op 96 B/op 4 allocs/op BenchmarkGetAuthKeyOld BenchmarkGetAuthKeyOld-32 4884744 244.7 ns/op 128 B/op 6 allocs/op ``` Use this patch for benchmark: [patch.txt](https://github.com/fatedier/frp/files/10415430/patch.txt) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:47:16 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#4711
No description provided.