Strongbox: Improve `npm view` command performance for remote repositories

Created on 25 Oct 2019  路  3Comments  路  Source: strongbox/strongbox

Task Description

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.

Tasks

The following tasks will need to be carried out:

  • [ ] Create NpmRepositoryFeatures.areThereAnyAlreadyCachedRemotePackages method (maybe with better name :smiley: )
  • [ ] Drop NpmRepositoryFeatures.countPackages method

Task Relationships

This task:

  • Depends on: #1649 ( #1676 )
  • Relates to: #1573

Help

  • Our chat
  • Points of contact:

    • @carlspring

    • @fuss86

    • @sbespalov

    • @steve-todorov

bug on hold

Most helpful comment

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

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings