From 54a0a377e03074a27d7d9e84092487c55761b510 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Tue, 26 Jul 2022 15:41:13 +0200 Subject: threads: debounce client-side thread building Debounce client-side thread building in the message store. Debouncing is useful when multiple messages are loaded, i.e. when scrolling with PgUp/PgDown. Without the debouncing, all client-side threads will be built everytime the message store is updated which creates a noticable lag in the message list ui when client-side threading is activated. The default debouncing delay can be changed by changing 'client-threads-delay' in the UI config section. Signed-off-by: Koni Marti Acked-by: Robin Jarry --- config/aerc.conf | 5 +++++ config/config.go | 2 ++ 2 files changed, 7 insertions(+) (limited to 'config') diff --git a/config/aerc.conf b/config/aerc.conf index f07900d..3b7b5d6 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -179,6 +179,11 @@ completion-popovers=true # Default: false #force-client-threads=false +# Debounce client-side thread building +# +# Default: 50ms +#client-threads-delay=50ms + [statusline] # Describes the format string for the statusline. # diff --git a/config/config.go b/config/config.go index 6a8be10..233f2e0 100644 --- a/config/config.go +++ b/config/config.go @@ -48,6 +48,7 @@ type UIConfig struct { MouseEnabled bool `ini:"mouse-enabled"` ThreadingEnabled bool `ini:"threading-enabled"` ForceClientThreads bool `ini:"force-client-threads"` + ClientThreadsDelay time.Duration `ini:"client-threads-delay"` FuzzyComplete bool `ini:"fuzzy-complete"` NewMessageBell bool `ini:"new-message-bell"` Spinner string `ini:"spinner"` @@ -712,6 +713,7 @@ func LoadConfigFromFile(root *string) (*AercConfig, error) { EmptyMessage: "(no messages)", EmptyDirlist: "(no folders)", MouseEnabled: false, + ClientThreadsDelay: 50 * time.Millisecond, NewMessageBell: true, FuzzyComplete: false, Spinner: "[..] , [..] , [..] , [..] , [..], [..] , [..] , [..] ", -- cgit v1.2.3