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

More resilient file saving by a two-stage file save process - Issues 1096, 1128 #1150

Closed
wants to merge 8 commits into from

Conversation

anesthetice
Copy link
Contributor

@anesthetice anesthetice commented Jul 19, 2024

Implementation of a two-stage file save process:

  1. Serialized and compressed data saved to a temporary file in the same directory (.tmp)
  2. Checksum calculated from the internal bytes using crc32fast (MIT license)
  3. External checksum calculated from the temporary file
  4. If the checksum match, the previous save file is removed, and the temporary file is renamed
  5. File watcher updated with the new save file

According to my simple benchmarks (EndeavourOS, Ryzen 5 5500U) , this does impact the saving time, but not significantly so:

2024-07-19-110837_hyprshot
2024-07-19-110925_hyprshot

@anesthetice anesthetice changed the title More resilient file saving by a two-stage file save process - Issue 1096 More resilient file saving by a two-stage file save process - Issues 1096, 1128 Jul 19, 2024
@anesthetice
Copy link
Contributor Author

Closing this as I want to implement this (+ make a couple of improvements) in #1177

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.

1 participant