-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
archive: Generate crc32 over 16MiB chunks #6274
archive: Generate crc32 over 16MiB chunks #6274
Conversation
Running crc32 over the whole content of the compressed file potentially requires a lot of RAM. The crc32 function in zlib allows for calculating the checksum in chunks. This changes the code to calculate the checksum over 16 MiB chunks instead. 16 MiB is the value also used by shutil.copyfileobj().
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.
Thanks for your contribution! The implementation looks good to me, I've added a comment on the changelog below.
changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml
Outdated
Show resolved
Hide resolved
changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml
Outdated
Show resolved
Hide resolved
Change the type of change to bugfix Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
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.
Looks good to me! If nobody objects, I'll merge in ~a week.
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.
LGTM
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #6325 🤖 @patchback |
* archive: Generate crc32 over 16MiB chunks Running crc32 over the whole content of the compressed file potentially requires a lot of RAM. The crc32 function in zlib allows for calculating the checksum in chunks. This changes the code to calculate the checksum over 16 MiB chunks instead. 16 MiB is the value also used by shutil.copyfileobj(). * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Change the type of change to bugfix Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 14b19af)
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #6326 🤖 @patchback |
@nilsmeyer thanks for your contribution! |
* archive: Generate crc32 over 16MiB chunks Running crc32 over the whole content of the compressed file potentially requires a lot of RAM. The crc32 function in zlib allows for calculating the checksum in chunks. This changes the code to calculate the checksum over 16 MiB chunks instead. 16 MiB is the value also used by shutil.copyfileobj(). * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Change the type of change to bugfix Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 14b19af)
@felixfontein Thanks for your valuable input and review. 10/10, would pull request again ;) |
…6MiB chunks (#6325) archive: Generate crc32 over 16MiB chunks (#6274) * archive: Generate crc32 over 16MiB chunks Running crc32 over the whole content of the compressed file potentially requires a lot of RAM. The crc32 function in zlib allows for calculating the checksum in chunks. This changes the code to calculate the checksum over 16 MiB chunks instead. 16 MiB is the value also used by shutil.copyfileobj(). * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Change the type of change to bugfix Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 14b19af) Co-authored-by: Nils Meyer <nils@nm.cx>
…6MiB chunks (#6326) archive: Generate crc32 over 16MiB chunks (#6274) * archive: Generate crc32 over 16MiB chunks Running crc32 over the whole content of the compressed file potentially requires a lot of RAM. The crc32 function in zlib allows for calculating the checksum in chunks. This changes the code to calculate the checksum over 16 MiB chunks instead. 16 MiB is the value also used by shutil.copyfileobj(). * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Change the type of change to bugfix Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/6199-archive-generate-checksum-in-chunks.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 14b19af) Co-authored-by: Nils Meyer <nils@nm.cx>
SUMMARY
Running crc32 over the whole content of the compressed file potentially requires a lot of RAM. The crc32 function in zlib allows for calculating the checksum in chunks. This changes the code to calculate the checksum over 16 MiB chunks instead. 16 MiB is the value also used by shutil.copyfileobj().
Fixes: #6272
ISSUE TYPE
COMPONENT NAME
archive
ADDITIONAL INFORMATION