Skip to content

perf: make EventBus subscription removal O(1) via ID→type index#611

Closed
KrisSimon wants to merge 3 commits intomainfrom
migrate-stub-pr
Closed

perf: make EventBus subscription removal O(1) via ID→type index#611
KrisSimon wants to merge 3 commits intomainfrom
migrate-stub-pr

Conversation

@KrisSimon
Copy link
Copy Markdown
Member

Migrated from GitLab MR !215 (merged)
feature/eventbus-o1-removal-139main
Originally created: 2026-03-31
Merged: 2026-04-01
Author: Kris Simon

Summary

  • Adds a [UUID: String] side-map (idToType) in SubscriptionStore that records which event-type bucket each subscription belongs to
  • remove() now does an O(1) dictionary lookup to find the correct bucket instead of iterating all type buckets (was O(k×n))
  • The side-map is maintained on add, remove, and removeAll

Closes #139

Test plan

  • swift build succeeds
  • All 1576 tests pass (swift test)

@KrisSimon KrisSimon closed this Apr 10, 2026
@KrisSimon KrisSimon deleted the migrate-stub-pr branch April 10, 2026 15:02
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.

Add example for Merge action

1 participant