Community
Participate
Working Groups
When checking for changes synchronizeArtifactRepository ends up calling ... artifactRepository.getArtifactDescriptors(key); This is an O(n) call and when done once for each individual artifact being scanned is O(n^2). We should store a hash index of the artifactrepository keys to allow us to do the lookup checks in constant time. See: RepositoryLister.synchronizeArtifactRepository (line 307)
After digging around here I noticed that we don't have an efficient way to iterate over the artifact descriptors in an artifact repo. The current iteration approach of getting the artifact keys and then getting the related artifactdescriptors using the key is unfortunately O(n^2) because the getArtifactDescriptor(IArtifactKey key) call does a linear search of the contained descriptors. To fix this bug it looks like we need to consider allowing proper iteration or possibly query of an artifact repository.
Also see bug 238669 as if we're removing watched bundles this is going to get really slow.
Created attachment 107018 [details] patch This patch adds an ArtifactKey index to the SimpleArtifactRepository to allow us to retrieve ArtifactDescriptors in constant time.
Can you give some timing results on this patch so we can decide if it is worth putting in 3.4.1?
I've put timing results up in bug 238312 I've committed to the 3.5 stream to allow further testing.
Marking fixed along with bug 238312