From 804d94d0ccbaf95ce9bd84247822870286f07df7 Mon Sep 17 00:00:00 2001 From: Elena Torro Date: Mon, 9 Mar 2026 17:14:19 +0100 Subject: [PATCH] :wrench: Throttle hover-related WASM calls --- frontend/src/app/main/ui/workspace/viewport/hooks.cljs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs index b615fc4aa7..8557ca7458 100644 --- a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs @@ -219,6 +219,10 @@ (->> move-stream (rx/tap #(reset! last-point-ref %)) + ;; Throttle hover queries to avoid flooding the worker + ;; and reduce sync WASM calls (intersect-position-in-shape) + ;; when the main thread is busy with rendering. + (rx/throttle 16) ;; When transforming shapes we stop querying the worker (rx/merge-map query-point)))