mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6790] [MERGED] perf: reduce traffic formatter allocations #6456
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6456
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/MHSanaei/3x-ui/pull/6790
Author: @javi0guerrero4-cloud
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @MHSanaei
Base:
main← Head:perf/format-traffic-allocs📝 Commits (1)
ddb4f9dperf: reduce traffic formatter allocations📊 Changes
2 files changed (+8 additions, -4 deletions)
View changed files
📝
internal/util/common/format.go(+2 -4)📝
internal/util/common/format_test.go(+6 -0)📄 Description
Summary
This change replaces the shared traffic formatter's mt.Sprintf path with strconv.FormatFloat, which reduces per-call formatting overhead and allocation churn in status/report generation.
Why this helps
FormatTraffic is used in repeated traffic and status outputs. Avoiding the mt package here removes extra formatting work on a hot path while preserving the previous output format exactly.
Validation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.