Skip to content

Build your personal knowledge base with Trilium Notes

perf(setup): cap setup spinners at ~6 fps to cut CPU during initial sync

Elian Dorand47f776c70ad
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css
index 8ab6ece10f..3362c79b7a 100644
--- a/apps/client/src/setup.css
+++ b/apps/client/src/setup.css
@@ -338,6 +338,15 @@ body.setup.platform-darwin {
}
}
+/* Stepped rather than linear: a continuously-animating element forces the browser to render
+ at full display refresh rate (90+ fps on some phones) for as long as the spinner is visible.
+ Setup spinners stay on screen for the entire initial sync — measured at ~40% of a CPU core
+ on mobile — so cap them at ~6 frames/s, which looks the same at icon size. Scoped to setup
+ because other in-app animations may want the smoother framerate. */
+body.setup .bx-spin {
+ animation-timing-function: steps(12);
+}
+
/* Slide transitions */
.slide-page {
position: absolute;