real-debrid-downloader/src
Sucukdeluxe 67fe689e28 Performance: cache cloneSettings() between snapshots (400ms TTL)
cloneSettings() copies 85+ fields including 6 nested usage Maps and the
bandwidth schedule array. With ~700ms emit interval most snapshot ticks
clone identical settings. Add a time-based cache (400ms TTL) so most
snapshots reuse the previous clone.

Settings are mutated in-place by hot paths (provider usage tracking, debrid
key counters), so a reference check wouldn't catch changes — but the 400ms
TTL window is short enough that user-visible setting changes still appear
within one render cycle. replaceSettings() explicitly invalidates the
cache for immediate visibility on user setting changes.

The 4 architecturally-invasive items I considered for this round —
recordSpeed batching (already 120ms-bucketed, false alarm), full IPC state
diffing (392 mutation sites, too risky), list virtualization (variable
package heights make it complex), and per-channel settings/stats split
(invasive type changes) — are deferred. This caching change captures most
of the practical settings-clone savings without the architectural risk.

All 140 download-manager tests green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 13:57:15 +02:00
..
main Performance: cache cloneSettings() between snapshots (400ms TTL) 2026-04-19 13:57:15 +02:00
preload Refactor: Extractor in 18 Sektionen reorganisiert 2026-03-10 23:47:02 +01:00
renderer Performance: visiblePackages dep fix + ItemRow date memo + small Object.keys cuts 2026-04-19 13:46:57 +02:00
shared Fix Debrid-Link key rotation cascade failure, case-sensitive rename, and sample filter 2026-03-26 13:04:42 +01:00