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

Improve relink performance #614

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Toby222
Copy link

@Toby222 Toby222 commented Nov 29, 2024

Cache library files instead of rewalking library for every missing entry
Improved PR of #611 that also improves performance for sqlite
Fixes #610

Only a rudimentary fix that could probably be improved by putting the cache somewhere more sensible but this works:tm:

@CyanVoxel CyanVoxel added Type: Enhancement New feature or request Type: QoL A quality of life (QoL) enhancement or suggestion TagStudio: Library Relating to the TagStudio library system Priority: Low Doesn't require immediate attention Type: File System File system interactions labels Nov 29, 2024
@CyanVoxel
Copy link
Member

Not sure if this is intended to be ready or not, but I see it's still modifying code in the legacy /tagstudio/src/core/library/json.py file instead of the proper /tagstudio/src/core/library/alchemy/library.py file.

@Toby222
Copy link
Author

Toby222 commented Dec 2, 2024

Not sure if this is intended to be ready or not, but I see it's still modifying code in the legacy /tagstudio/src/core/library/json.py file instead of the proper /tagstudio/src/core/library/alchemy/library.py file.

No it modifies both JSON and SQL (Though the JSON is obviously superfluous by now, but adding an extra commit just to remove it is also superfluous so pblbll)
The SQL missing file check simply isn't located in the alchemy folder but instead in tagstudio/src/core/utils/missing_files.py from what I could see.

@CyanVoxel
Copy link
Member

Not sure if this is intended to be ready or not, but I see it's still modifying code in the legacy /tagstudio/src/core/library/json.py file instead of the proper /tagstudio/src/core/library/alchemy/library.py file.

No it modifies both JSON and SQL (Though the JSON is obviously superfluous by now, but adding an extra commit just to remove it is also superfluous so pblbll) The SQL missing file check simply isn't located in the alchemy folder but instead in tagstudio/src/core/utils/missing_files.py from what I could see.

Maybe there's been a misunderstanding, I am asking you to not modify the legacy JSON library file. This file should not have feature code added to it at all.

@Toby222
Copy link
Author

Toby222 commented Dec 2, 2024

Yup, I misunderstood what you meant ^^;
SQL-only now

@@ -19,6 +19,7 @@ class MissingRegistry:
library: Library
files_fixed_count: int = 0
missing_files: list[Entry] = field(default_factory=list)
library_file_cache: set[Path] = None
Copy link
Member

Choose a reason for hiding this comment

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

#608 already added a library file cache here. Could you leverage that one instead of adding a new one?

@CyanVoxel CyanVoxel added the Status: Changes Requested Changes are quested to this label Dec 6, 2024
@CyanVoxel
Copy link
Member

@Toby222 Any updates on this?

@Toby222
Copy link
Author

Toby222 commented Dec 21, 2024

@Toby222 Any updates on this?

No, I got distracted by book releases and forgot until now :^)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Doesn't require immediate attention Status: Changes Requested Changes are quested to this TagStudio: Library Relating to the TagStudio library system Type: Enhancement New feature or request Type: File System File system interactions Type: QoL A quality of life (QoL) enhancement or suggestion
Projects
Status: 🚧 In progress
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Optimize _match_missing_file
2 participants