Skip to content
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

[MINDEXER-191] Avoid group rebuilding during incremental updates #318

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

mbien
Copy link
Member

@mbien mbien commented Jun 7, 2023

Rebuilding of the in-memory group data takes more time than the index update itself since it has to iterate through the full index.

What is worse is that rebuilding happens in a loop for each chunk:

public void addIndexChunk(ResourceFetcher source, String filename) throws IOException {
loadIndexDirectory(updateRequest, source, true, filename);
}

The reader has all group data of the extracted incremental update already, while the context should have the group data of the current index.

If we assume that maven group IDs are rarely removed we can simply merge both collections without having to rebuild anything.

  • typical maven central index updates are >4x faster without group rebuilding (<70s on an i6700k)
  • minor optimizations and deprecation fixes (additional ~10% faster merge)

context:

#202 moved the groups from index to memory storage which is why NetBeans is persisting the group data after maven-indexer did the extraction apache/netbeans#4136. When the index context is loaded the group data is restored by NB. Incremental updates can simply add more groups to that collection.

Other use cases might want to call IndexingContext#rebuildGroups() explicitly, if this isn't done, the context will have only the groups of the incremental update, post update.


https://issues.apache.org/jira/browse/MINDEXER-191

Rebuilding of the in-memory group data takes more time than
the index update itself since it has to iterate through the full index.

The reader has all group data of the extracted incremental update,
while the context should have the group data of the current index.

If we assume that maven group IDs are rarely removed we can simply
merge both collections without having to rebuild anything.

+ minor optimizations and deprecation fixes
@mbien mbien marked this pull request as ready for review June 9, 2023 19:35
@cstamas cstamas changed the title Avoid group rebuilding during incremental updates [MINDEXER-191] Avoid group rebuilding during incremental updates Jun 13, 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.

2 participants