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

refactor: Speedup /projects endpoint #2824

Merged
merged 4 commits into from Sep 6, 2023

Conversation

seakayone
Copy link
Collaborator

@seakayone seakayone commented Sep 5, 2023

Load Ontologies from db with single query and parallelise converting KnoraProject to ProjectADM

Pull Request Checklist

Task Description/Number

NO-TICKET

I found that loading the start page with the project overview takes very long.
This is partly due to the fact that the app is loading the projects list with /project which is a slow endpoint, which is also called twice during initial loading.

This change speeding up the conversion of a KnoraProject to a richer ProjectADM by parallelising the lookup of the ontology a project is attached to. Since the cache and an actual database lookup are pretty similar I have also removed the dependency on the OntologyCache.

Basic Requirements

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • fix: represents bug fixes
  • refactor: represents production code refactoring
  • feat: represents a new feature
  • docs: documentation changes (no production code change)
  • chore: maintenance tasks (no production code change)
  • test: all about tests: adding, refactoring tests (no production code change)
  • other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No
  • Maybe (not 100% sure => check with FE)

Does this PR change client-test-data?

  • Yes (don't forget to update the JS-LIB team about the change)
  • No

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: +69.85% 🎉

Comparison is base (12402f3) 18.00% compared to head (0187a24) 87.85%.
Report is 48 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2824       +/-   ##
===========================================
+ Coverage   18.00%   87.85%   +69.85%     
===========================================
  Files         281      242       -39     
  Lines       28899    23323     -5576     
===========================================
+ Hits         5202    20490    +15288     
+ Misses      23697     2833    -20864     

see 223 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seakayone seakayone self-assigned this Sep 5, 2023
@seakayone seakayone marked this pull request as ready for review September 5, 2023 11:55
@@ -29,6 +29,9 @@ final case class KnoraProjectRepoInMemory(projects: Ref[List[KnoraProject]])
}
)
)

override def findOntologies(project: KnoraProject): Task[List[InternalIri]] =
throw new UnsupportedOperationException("not implemented (yet)")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new UnsupportedOperationException("not implemented (yet)")
throw new UnsupportedOperationException("Not yet implemented.")

@@ -29,6 +29,9 @@ final case class KnoraProjectRepoInMemory(projects: Ref[List[KnoraProject]])
case IriIdentifier(iri) => _.id.value == iri.value
})
)

override def findOntologies(project: KnoraProject): Task[List[InternalIri]] =
throw new UnsupportedOperationException("not yet implemented")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new UnsupportedOperationException("not yet implemented")
throw new UnsupportedOperationException("Not yet implemented.")

@seakayone seakayone merged commit 22d5146 into main Sep 6, 2023
13 checks passed
@seakayone seakayone deleted the refactor/speedup-projects-list-endpoint branch September 6, 2023 07:27
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.

None yet

2 participants