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

perf: optimize query methods and reduce preview panel updates #794

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

CyanVoxel
Copy link
Member

Summary

This PR makes several performance improvements to the way that query methods are executed, how toggled badges update entries with tag changes, and how toggled badges update the preview panel.

The main part of this PR is the restructuring of the get_entries_full() method, which now queries the tags separately from the base entry query and recombines them into a final Entry object. I was unable to optimize the preexisting query statement itself, however this recombination method provides a huge performance boost (~10x) for large complex libraries - so much so that the badge optimizations have become almost overshadowed by this change.

NOTE: In theory this approach opens the doors for a visual state mismatch between the tags shown and the tags on the actual entry. The performance increase comes from the fact that `get_entry_full()` isn't called, which is the real bottleneck here.
@CyanVoxel CyanVoxel added Type: Refactor Code that needs to be restructured or cleaned up Type: QoL A quality of life (QoL) enhancement or suggestion Priority: High An important issue requiring attention TagStudio: Search The TagStudio search engine labels Feb 6, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5 (Post-SQL) milestone Feb 6, 2025
@CyanVoxel CyanVoxel added the Type: Performance An issue or change related to performance label Feb 6, 2025
@CyanVoxel CyanVoxel merged commit 6b646f8 into main Feb 10, 2025
10 checks passed
@CyanVoxel CyanVoxel deleted the preview-panel-optimizations branch February 10, 2025 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High An important issue requiring attention TagStudio: Search The TagStudio search engine Type: Performance An issue or change related to performance Type: QoL A quality of life (QoL) enhancement or suggestion Type: Refactor Code that needs to be restructured or cleaned up
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant