Skip to content

Fix #17577: scaladoc hangs with deep inheritance #17954

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

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

reardonj
Copy link
Contributor

@reardonj reardonj commented Jun 11, 2023

This commit has a pair of fixes that bring the scaladoc build time for the repository mentioned in #17577 to a minute instead of hanging.

  • Reimplement HierarchyGraph's + method in terms of ++ Previously, ++ was implemented in terms of +, but + called distinct resulting in poor performance. Now distinct is only called once for a ++ call.
  • Get the distinct LinkToType values in InheritanceInformationTransformer.apply. Previously, subtypes could contain duplicates, causing redundant calls to getEdges

This commit has a pair of fixes that bring the scaladoc build time for the repository mentioned in scala#17577 to a minute instead of hanging.

- Reimplement HierarchyGraph's `+` method in terms of `++` Previously, `++` was implemented in terms of `+`, but `+` called `distinct` resulting in poor performance. Now `distinct` is only called once for a `++` call.
- Get the distinct `LinkToType` values in `InheritanceInformationTransformer.apply`. Previously, `subtypes` could contain duplicates, causing redundant  calls to `getEdges`
@reardonj reardonj force-pushed the improve-HierarchyGraph-performance branch from b668562 to 9859e89 Compare June 11, 2023 23:47
@Florian3k Florian3k self-requested a review June 12, 2023 10:40
@Florian3k Florian3k self-assigned this Jun 12, 2023
Copy link
Contributor

@Florian3k Florian3k left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, LGTM

@Florian3k Florian3k merged commit e7fa5dc into scala:main Jun 16, 2023
@reardonj reardonj deleted the improve-HierarchyGraph-performance branch June 16, 2023 11:19
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 2, 2023
Kordyjan added a commit that referenced this pull request Nov 21, 2023
…18991)

Backports #17954 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
@Kordyjan Kordyjan modified the milestones: 3.4.0, 3.3.2 Dec 14, 2023
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