Commit b2a66ab
perf: optimize category and profile calculation in CategoryFilterWidget
Combine the calculation of activeCategories and uniqueProfiles into a single
useMemo hook that iterates over the shortcuts array once using standard
for loops. This replaces multiple mapping, flatMapping, and spreading operations
which are computationally expensive and trigger garbage collection unnecessarily.
Co-authored-by: alazndy <78882672+alazndy@users.noreply.github.com>1 parent 7593f90 commit b2a66ab
1 file changed
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | | - | |
14 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
15 | 26 | | |
16 | 27 | | |
17 | 28 | | |
| |||
0 commit comments