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

5x Fix cache performance issues #6616

Merged
merged 6 commits into from
Aug 13, 2024
Merged

Conversation

bosiraphael
Copy link
Contributor

Calling getObjectMetadata from WorkspaceCacheStorageService in every query was causing big performance issues. The objectMetadataCollection is now part of the WorkspaceInternalContext so we only instance it once in the WorkspaceDatasourceFactory.
Queries are now much faster, for instance for TimelineCalendar, it went from ~450ms to 80ms.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request addresses significant cache performance issues by optimizing the handling of object metadata in the Twenty ORM system.

  • Introduced objectMetadataCollection in WorkspaceInternalContext to reduce repeated calls to getObjectMetadata
  • Modified WorkspaceDatasourceFactory to instantiate objectMetadataCollection once per workspace
  • Refactored determineRelationDetails function in entity-schema-relation.factory.ts to use the new objectMetadataCollection
  • Updated WorkspaceRepository class for more efficient data retrieval and improved error handling
  • Achieved substantial performance improvements, reducing query times (e.g., TimelineCalendar queries from ~450ms to 80ms)

5 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

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

LGTM!

@charlesBochet charlesBochet merged commit 40bbee8 into main Aug 13, 2024
5 checks passed
@charlesBochet charlesBochet deleted the fix-cache-performance-issues branch August 13, 2024 15:54
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