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

Patch/performance fixes #620

Merged
merged 4 commits into from
Jan 13, 2025
Merged

Patch/performance fixes #620

merged 4 commits into from
Jan 13, 2025

Conversation

jclausen
Copy link
Contributor

Description

This PR resolves several performance issues seen in the wild:

  • getActiveContent has been refactored to allow an asString boolean arg. When passed as true this will execute a projection list query to retrieve the content string only. This is demonstrating a significant performance improvement - especially when ContentStore items contain JSON which is exposed directly from the API
  • A read-only activeContentVersions property has been added to prevent retrieval of all versions. This is a significant performance improvement when the content item has a large number of revisions, compared to looping all versions.
  • The fetch="join" attribute has been removed from the ContentVersion relatedContent relationship as this is mutually exclusive to lazy="true" the queries being executed when retrieving content items alone were producing the join, but also the joins from the BaseContent and were significantly increasing version entity retrieval times.

Type of change

Please delete options that are not relevant.

  • Improvement

Checklist

  • My code follows the style guidelines of this project cfformat
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@@ -311,14 +311,28 @@ component
singularName="contentVersion"
fieldtype ="one-to-many"
type ="array"
lazy ="true"
lazy ="extra"
Copy link
Contributor

Choose a reason for hiding this comment

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

good call!

@lmajano lmajano merged commit 08df5e9 into development Jan 13, 2025
2 of 25 checks passed
@lmajano lmajano deleted the patch/performance-fixes branch January 13, 2025 20:06
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