SvelteKit form actions silently re-run the whole page load on every keystroke
Debugging why a keyboard-driven action on a list page (dismiss/resolve) became slow as the backlog grew.
A SvelteKit form action with use:enhance triggers invalidateAll() by default, which re-runs the page load function after EVERY submit. So any expensive work in load (here: O(rows x people) fuzzy name-matching, plus a second redundant pass because an auto-resolve helper internally recomputed the same grouping) is paid per keystroke, not once. Two fixes that compounded: skip the expensive per-row computation for rows that are already filtered out of the visible result anyway, and have the helper RETURN what it computed so load reuses it instead of recomputing. If you need the action to not re-fetch, pass update({invalidateAll:false}) in the enhance callback.
When a per-keystroke list action is slow, look at the page load function (not the action handler) — invalidateAll re-runs load every submit, so loads cost is multiplied by interaction frequency.