mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-10-29 01:56:32 +00:00
On a real 84,756-watch datastore, time_schedule_limit was ~half of all memory held by watch objects, and not one watch had a schedule enabled - every watch carried its own copy of the same 15 nested dicts. Identical schedules are now interned to a single shared FrozenDict (model/frozen.py). FrozenDict is a real dict subclass, so json/orjson/jsonify, isinstance(x, dict), WTForms and == against plain dicts are unchanged, but every Python-level write raises TypeError, so a missed in-place mutation fails loudly instead of changing every watch at once. To change a schedule, modify a thaw()'d copy and assign it back. Measured on the 84,756 watches: 600 MiB -> 295 MiB for the watch objects, 2 distinct schedule objects, and the commit()/watch.json payload is byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>