From 4759e5899474b6478a048308a8cb42b1e053a7e1 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 4 Oct 2025 17:34:40 +0200 Subject: [PATCH] Reduce terminal progress fps to 10 --- changelog/unreleased/issue-5383 | 9 +++++++++ internal/ui/progress.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/issue-5383 diff --git a/changelog/unreleased/issue-5383 b/changelog/unreleased/issue-5383 new file mode 100644 index 000000000..9e79e6cf0 --- /dev/null +++ b/changelog/unreleased/issue-5383 @@ -0,0 +1,9 @@ +Enhancement: Reduce progress bar refresh rates to reduce energy usage + +Progress bars were updated with 60fps which can cause high CPU or GPU usage +for some terminal emulators. Reduce it to 10fps to conserve energy. +In addition, this lower frequency seem to be necessary to allow selecting +anything in the terminal with certain terminal emulators. + +https://github.com/restic/restic/issues/5383 +https://github.com/restic/restic/pull/5551 diff --git a/internal/ui/progress.go b/internal/ui/progress.go index b3a3226e9..12388f844 100644 --- a/internal/ui/progress.go +++ b/internal/ui/progress.go @@ -13,7 +13,7 @@ import ( // or if unset returns an interval for 60fps on interactive terminals and 0 (=disabled) // for non-interactive terminals or when run using the --quiet flag func CalculateProgressInterval(show bool, json bool, canUpdateStatus bool) time.Duration { - interval := time.Second / 60 + interval := time.Second / 10 fps, err := strconv.ParseFloat(os.Getenv("RESTIC_PROGRESS_FPS"), 64) if err == nil && fps > 0 { if fps > 60 {