Skip to content

Conversation

@shs96c
Copy link
Collaborator

@shs96c shs96c commented Nov 19, 2025

Replace O(n²) linear searches with O(1) hash set lookups when checking if a dependency is in the requested deps list. Previously, isRequestedDep() was called inside nested loops, doing a full stream().anyMatch() scan for every dependency and child dependency, causing long delays on large dependency graphs.

Now creates a Set lookup cache at the start of parseDependencies() and uses constant-time contains() checks instead of linear scans.

Replace O(n²) linear searches with O(1) hash set lookups when checking
if a dependency is in the requested deps list. Previously, isRequestedDep()
was called inside nested loops, doing a full stream().anyMatch() scan for
every dependency and child dependency, causing long delays on large
dependency graphs.

Now creates a Set<String> lookup cache at the start of parseDependencies()
and uses constant-time contains() checks instead of linear scans.
@shs96c shs96c requested review from cheister and jin as code owners November 19, 2025 04:53
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