Skip to content

[DOXIASITETOOLS-344] - Improve performance of case-sensitive file key checking #170

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
Sep 8, 2024

Conversation

jdimeo
Copy link
Contributor

@jdimeo jdimeo commented Sep 3, 2024

Our Maven site now has about 150,000 Doxia files to render (mostly Markdown and some ASCII doc). During profiling, I realized the Maven site plugin was spending around 18 minutes in the addModuleFiles() method. When looking at the code, I realized the algorithm was O(n² - n / 2) the way it adds each file it discovers to a map and the iterates through the map for each file.

This approach uses a secondary hash map to achieve O(2n) instead to check for a case-insensitive duplicate file to error on Windows and warn on other OSes.

(second attempt starting with the latest master branch and adding the ticket to the commit)

@asfgit asfgit merged commit a040bce into apache:master Sep 8, 2024
20 checks passed
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.

2 participants