You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: Condensation.forgotten_event_ids is a list, not a set — O(V×F) per application #3150
Condensation.forgotten_event_ids is list[EventID]. The apply() method does event.id not in self.forgotten_event_ids — an O(F) lookup per event where F is the number of forgotten events. Each condensation application is O(V×F). With K condensations over a conversation's lifetime, View.from_events replays all K, compounding to O(K×V×F).
Location:event/condenser.py:14, 91
Evidence
Code at event/condenser.py:91. The field is declared as list[EventID] at line 14.
Severity: Medium (will be addressed by incremental view work)
Impact of fix
Condensation application becomes O(V) instead of O(V×F).
Fix
Change list[EventID] to set[EventID]. Trivial.
Note: the planned incremental view work will make this less impactful since View.from_events won't replay the full history.
Activity