mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-22 13:55:01 +03:00
perf: reduce traffic formatter allocations (#6790)
Co-authored-by: Javier Guerrero <javier.guerrero@github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -26,3 +26,9 @@ func TestFormatTraffic(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFormatTraffic(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = FormatTraffic(1536 + int64(i%64)*1024)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user