Skip to content

Fix ActivityLog perf: incremental append + cap in-memory entries#9

Open
phyceClaw wants to merge 1 commit into
phyce:python-integrationfrom
phyceClaw:fix/activitylog-perf
Open

Fix ActivityLog perf: incremental append + cap in-memory entries#9
phyceClaw wants to merge 1 commit into
phyce:python-integrationfrom
phyceClaw:fix/activitylog-perf

Conversation

@phyceClaw

Copy link
Copy Markdown

Summary

ActivityLog.vue rebuilt a Map and full-sorted entries on every activity.appended event — O(n log n) per event, which thrashes under a burst of log events. And entries grew unboundedly for the lifetime of the window.

  • Live appends now do an ordered insert with id de-dupe instead of a full merge+sort; the full merge is kept only for bulk load-older/initial paths.
  • In-memory entries are capped; older entries remain in the backing .jsonl and reload via load-older.

Existing filters, chain grouping, focusChain deep-link, and scroll-triggered load-older are preserved.

Testing

See PR notes re: whether a full npm run build could run in this environment.

🤖 Generated with Claude Code

mergeEntries rebuilt a Map and full-sorted entries on every appended
event (O(n log n) per event, thrashes under log bursts). Append live
entries in order with an id de-dupe instead, keeping the full merge
only for bulk load-older/initial paths. Cap in-memory entries so a
long session no longer grows unboundedly (older entries remain in the
backing .jsonl and reload on demand).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant