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

Replace MD5 with CRC32 for 2x checksum speed #56

Closed
wants to merge 2 commits into from

Conversation

adiov
Copy link
Contributor

@adiov adiov commented Jan 5, 2025

While running this script on a large pool, I noticed that that the MD5 checksum calculation is taking up to 2-3 minutes on the large video project files. By changing to CRC32, I was able to cut down the checksum time by nearly 50% on most files.

For the purpose of adversarial integrity checking, CRC32 is not adequate, and neither is MD5. However, for the purpose of successful copying and corruption checking, CRC32 is adequate. Using MD5 for this script is burning double the CPU cycles for no gain.

Running ./testing.sh passes all the checks on TrueNAS Scale 24.10, Debian Bookworm, and MacOS Sequoia.

adiov added 2 commits January 5, 2025 03:22
Removing tmp_extension is not needed because awk already removes everything except the checksum value
@markusressel
Copy link
Owner

Hey @adiov , this looks like a good idea indeed 👍
Could you please rebase onto the latest changes to resolve the conflict?
This will also make sure this change works on all platforms. Thx!

@adiov
Copy link
Contributor Author

adiov commented Jan 6, 2025

I'll close this PR and open a new one. This should keep the commit history neater.

@adiov adiov closed this Jan 6, 2025
@adiov adiov deleted the patch-1 branch January 6, 2025 00:19
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.

2 participants