Skip to content

Conversation

@folkol
Copy link

@folkol folkol commented Sep 27, 2025

Hi,

we ran into some performance problems constructing graphs with high-degree nodes, and using Sets instead of Arrays for as Adjacency Lists worked for us.

(We spent almost 100% of the time on this line while inserting new dependencies because we had high-degree nodes in the graph.)

  • It shouldn't hurt anyone since Sets iterate in insertion-order, same as Arrays.
  • We're creating a copy of the adjacency list during DFS traversal "to be order-compatible with the old DFS implementation", a suggestion could be to iterate in natural order and bump the major version?

- also fixed bug in another Performance test: elapsed -> end - start
- Preserve behavior since Sets respect insertion order
- Improve performance when constructing graphs with high-degree nodes
- Create Array copies in a few places to preserve behavior
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