Files
dgtlmoonandClaude Opus 5.5 07a30383ab Watch memory - share one read-only copy of identical time_schedule_limit values
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>
2026-10-26 13:40:32 +01:00
..
…
2026-10-26 12:59:13 +01:00
2026-10-26 12:59:13 +01:00
…