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

Add caching of datetimes to improve performance. #518

Merged
merged 5 commits into from
Jan 28, 2024
Merged

Add caching of datetimes to improve performance. #518

merged 5 commits into from
Jan 28, 2024

Conversation

mauteri
Copy link
Contributor

@mauteri mauteri commented Jan 28, 2024

Description of the Change

PR #508 was reverted due to bug not invalidating cache on update. This PR replaces cache with transient API so DB calls aren't repeated.

Closes #507

How to test the Change

Functionality around datetime should remain same. Use Query Monitor to see no more repeated calls to get_datetime method, which resulted in duplicated DB calls.

Credits

Props @mauteri, @deshabhishek007

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@mauteri
Copy link
Contributor Author

mauteri commented Jan 28, 2024

@deshabhishek007 new PR that combines aspects of your PR to make fewer DB calls by utilizing the event object to store data in properties. Let me know what you think. Thx!

@jmarx
Copy link
Collaborator

jmarx commented Jan 28, 2024

@mauteri Nice!

…nt extra DB calls. Removed caching as transients will take over.
@mauteri mauteri merged commit 74d989f into main Jan 28, 2024
10 checks passed
@mauteri mauteri deleted the GP-507 branch January 28, 2024 14:17
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.

Performance Issue: get_formatted_datetime() Called too many times, Duplicate Queries in Query Monitor
2 participants