Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(GraphEdge): Disable events on GraphEdge #170

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

donmccurdy
Copy link
Owner

@donmccurdy donmccurdy commented Oct 25, 2024

Currently the GraphEdge class extends EventDispatcher, and emits 'dispose' events. These events are used (internally, only) to maintain references between GraphNodes. If an edge is disposed, the parent GraphNode is listening for that event and will remove its own reference to the GraphEdge.

In large graphs (1M+ nodes) these listeners require non-trivial memory allocation, and bulk disposal is slower than necessary because the process relies heavily on event callbacks.

Because the events have always been for 'internal' use, I believe it should be safe to remove events on the GraphEdge class, and to implement the required reference maintenance without them.

The change will be published as a v2 → v3 update.

@donmccurdy donmccurdy marked this pull request as ready for review October 25, 2024 15:29
@donmccurdy donmccurdy force-pushed the refactor/disable-graphedge-events branch from 36198bd to a284e1b Compare October 27, 2024 15:42
@donmccurdy donmccurdy force-pushed the refactor/disable-graphedge-events branch from a284e1b to 839f0ff Compare October 27, 2024 16:02
@donmccurdy donmccurdy changed the title refactor: Disable events on GraphEdge refactor(GraphEdge): Disable events on GraphEdge Oct 27, 2024
@donmccurdy donmccurdy merged commit 05966bf into main Oct 27, 2024
1 check passed
@donmccurdy donmccurdy deleted the refactor/disable-graphedge-events branch October 27, 2024 16:05
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