From eb4eb7524d2aa899fa2444abe7c6af7d9e635378 Mon Sep 17 00:00:00 2001 From: Tommy van der Vorst Date: Fri, 19 Sep 2025 07:17:10 +0200 Subject: [PATCH] fix(syncthing): only perform CPU benchmark on startup when logging enabled, and on goroutine (#10398) Signed-off-by: Tommy van der Vorst Co-authored-by: bt90 --- lib/syncthing/syncthing.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/syncthing/syncthing.go b/lib/syncthing/syncthing.go index 7f74aa6db..f3aaba8ec 100644 --- a/lib/syncthing/syncthing.go +++ b/lib/syncthing/syncthing.go @@ -162,8 +162,12 @@ func (a *App) startup() error { }() } - perf := ur.CpuBench(context.Background(), 3, 150*time.Millisecond) - slog.Info("Measured hashing performance", "perf", fmt.Sprintf("%.02f MB/s", perf)) + if slog.Default().Enabled(context.Background(), slog.LevelInfo) { + go func() { + perf := ur.CpuBench(context.Background(), 3, 150*time.Millisecond) + slog.Info("Measured hashing performance", "perf", fmt.Sprintf("%.02f MB/s", perf)) + }() + } if a.opts.ResetDeltaIdxs { slog.Info("Reinitializing delta index IDs")