perf(recipes/search): memoise per-recipe normalized search string

Every keystroke the filter rebuilt the lowercased + diacritic-stripped
+ soft-hyphen-stripped concat of name/description/tags per recipe. For
a 200+ recipe catalogue that's a lot of regex work on the hot path.

Cache the normalised string in a WeakMap keyed by the recipe object;
first keystroke still pays the full cost, every subsequent one is a
single indexOf per recipe.

Picked client-side memoisation over the audit's suggested server-side
`_searchKey` to avoid duplicating every recipe's text over the wire.
This commit is contained in:
2026-04-23 15:50:08 +02:00
parent 38330d7020
commit c01dff197f
3 changed files with 31 additions and 19 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "homepage",
"version": "1.46.24",
"version": "1.46.25",
"private": true,
"type": "module",
"scripts": {