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

Optimization opportunity for hash checks of partially downloaded files #1255

Open
loskutov opened this issue Dec 9, 2023 · 0 comments
Open

Comments

@loskutov
Copy link

loskutov commented Dec 9, 2023

Operating systems provide APIs (FIEMAP ioctl in case of Linux, who really cares about others) to get the information regarding underlying FS extents of a file, including whether the extent is zero-initialized and never touched afterwards (FIEMAP_EXTENT_UNWRITTEN). For the pieces that are located inside such extents, it's obvious in advance that sha(block) = sha('\0' * block_size), so the SHA computation can be bypassed. It can significantly improve recheck times in cases when rtorrent was killed while downloading.

@loskutov loskutov changed the title Optimization opportunity for integrity checks of partially downloaded files Optimization opportunity for hash checks of partially downloaded files Dec 9, 2023
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

No branches or pull requests

1 participant