Skip to content

perf(graph-algos): optimize neighbor filtering in SCC with HashSet lookup#9442

Open
0xxFloki wants to merge 1 commit intostarkware-libs:mainfrom
0xxFloki:patch-9
Open

perf(graph-algos): optimize neighbor filtering in SCC with HashSet lookup#9442
0xxFloki wants to merge 1 commit intostarkware-libs:mainfrom
0xxFloki:patch-9

Conversation

@0xxFloki
Copy link
Contributor

Optimize get_neighbors_in_given_scc by replacing O(n²) Vec scanning with O(n) HashSet lookup.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orizi made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @0xxFloki).


a discussion (no related file):
in the general case - probably correct.

at our normal case - would be much slower. as the scc sets are usually extremely small, hash maps are basically just a big waste.
(as linear search is more efficient up until ~200 elements)

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.

3 participants