From 04097e874388bf30e808a9a9993230c668a36ec4 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 17 Jul 2022 08:03:43 -0500 Subject: msgstore: do not build threads when threaded view is off Commit 3a614e45fce9 ("threading: enable toggle-threads for server-side threads") changed the behavior of the msgstore.buildThreads variable to reflect whether the client needs to build threads or the server will. However, a call to runThreadbuilder was not updated with an extra conditional. As a result, threads were built regardless of the state of the threadedView resulting in a large performance penalty for non-threaded views with client side threading. Only run thread builder if threaded view is enabled. Fixes: 3a614e45fce9 ("threading: enable toggle-threads for server-side threads") Reported-by: akspecs Signed-off-by: Tim Culverhouse Acked-by: Akspecs Acked-by: Robin Jarry --- lib/msgstore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/msgstore.go') diff --git a/lib/msgstore.go b/lib/msgstore.go index a54b20bb..240d4b7a 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -356,7 +356,7 @@ func (store *MessageStore) update() { if store.onUpdateDirs != nil { store.onUpdateDirs() } - if store.BuildThreads() { + if store.BuildThreads() && store.ThreadedView() { store.runThreadBuilder() } } -- cgit