2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00
restic/internal/ui
greatroar 49e32f3f8a ui/termstatus: Optimize Truncate
x/text/width.LookupRune has to re-encode its argument as UTF-8,
while LookupString operates on the UTF-8 directly.
The uint casts get rid of a bounds check.

Benchmark results, with b.ResetTimer introduced first:

name               old time/op  new time/op  delta
TruncateASCII-8    69.7ns ± 1%  55.2ns ± 1%  -20.90%  (p=0.000 n=20+18)
TruncateUnicode-8   350ns ± 1%   171ns ± 1%  -51.05%  (p=0.000 n=20+19)
2023-04-14 11:13:39 +02:00
..
backup ui/backup: Fix percent and eta in backup progress 2023-01-21 13:25:08 -07:00
progress progress: extract progress updating into Updater struct 2023-01-14 01:13:08 +01:00
signals add go:build headers everywhere 2022-03-28 22:23:47 +02:00
table avoiding unnecessary type conversions 2019-06-30 23:58:00 +03:00
termstatus ui/termstatus: Optimize Truncate 2023-04-14 11:13:39 +02:00
format_test.go ui: Fix FormatBytes at exactly 1024 time a unit 2022-10-31 18:39:28 +01:00
format.go ui: Fix FormatBytes at exactly 1024 time a unit 2022-10-31 18:39:28 +01:00
message.go Use new archiver code for backup 2018-04-28 22:08:11 +02:00
stdio_wrapper_test.go Simplify ui.StdioWrapper.Write 2020-10-17 20:30:46 +02:00
stdio_wrapper.go Simplify ui.StdioWrapper.Write 2020-10-17 20:30:46 +02:00