The npm install @angular/core (for example) execution currently can take about 20 seconds. The problem related with NpmRepositoryFeatures.countPackages method, SQL query that happens there counts ArtifactEntries to check if there are cached entities or not. We can rework this by using something like SELECT 1 FROM RepositoryArtifactIdGroupEntry WHERE ... LIMIT 1. Also we should be sure that new query triggers RepositoryArtifactIdGroupEntry index.
The following tasks will need to be carried out:
NpmRepositoryFeatures.areThereAnyAlreadyCachedRemotePackages method (maybe with better name :smiley: )NpmRepositoryFeatures.countPackages methodThis task:
the problem is that currently we have RemoteRepositorySearchEvent.predicate which is used by NpmRepositoryFeatures.SearchPackagesEventListener to find cached packages and these predicate assumed to be based on ArtifactEntry. Regarding the issue requirments we should use RepositoryArtifactIdGroupEntry to build predicate search conditions and it should stay be based on ArtifactEntry. This probably will require to improve API that we have in org.carlspring.strongbox.data.criteria and better to be done after #1573
@sbespalov ,
Is this something that can now be worked on based on the issue-1649 branch?
We should check and see how it works on the issue-1649 branch.
Most helpful comment
the problem is that currently we have
RemoteRepositorySearchEvent.predicatewhich is used byNpmRepositoryFeatures.SearchPackagesEventListenerto find cached packages and thesepredicateassumed to be based onArtifactEntry. Regarding the issue requirments we should useRepositoryArtifactIdGroupEntryto buildpredicatesearch conditions and it should stay be based onArtifactEntry. This probably will require to improve API that we have inorg.carlspring.strongbox.data.criteriaand better to be done after #1573