-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
serialize/deserialize colors to/from bytes instead of strings #1049
Conversation
it's a tiny bit faster and saves a bit of memory
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not tested but looks good.
Sorry I forgot to mention that this requires users to delete their picture cache. This PR so far doesn't handle old format caches gracefully. Any suggestions? |
@Dobatymo This looks pretty good, I do want to spend some more time actually running this. With regards to the picture cache, for the sqlite implementation this could do something similar to what has been done with the file cache db to automatically migrate and clear out the db when changes are made see the class at Line 96 in 1f1dfa8
|
Merged in changes to resolve a couple minor conflicts from changes I made recently (removing shelve cache, formatting). Going to be looking at adding a migration to the picture db similar to the other so users don't have to worry about manually clearing cache. |
Thank you for keep working on my PR :) |
- Add migration (just delete db and change to new schema) for picture cache following the same sort of strategy as the file digest cache - Rename mtime column to mtime_ns to match file cache for consistency
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@Dobatymo No problem, got the changes pulled in here to "migrate" the cache now, will do a bit more testing on my end then merge this as I think it all looks good to go. |
It's a tiny bit faster, saves a bit of memory and simplifies the code a bit. Also if in the future 3rd party perceptual hashes will be used, it makes saving/restoring to/from numpy arrays even easier (and even faster), since it's only a
.tobytes()
or.frombuffer()
then.For benchmarking run