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

Add support for unpacking using custom Unpacker API #355

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alessandrod
Copy link

Hello!

This PR proposes introducing a new Unpacker trait to the API, and new unpack_with methods to Archive and Entry. The aim is to offer users a way to use specialized fs and IO operations to speed up unpacking.

Background: I work on a program that unpacks a really large .tar.zst (60G compressed, 188G uncompressed) at launch. Using tar-rs main which uses regular fs ops and io::copy, it takes about 4m30s to unpack. Using io_uring on linux, with pre-allocated huge page buffers etc, it takes about 1m30s uncompressing at ~1.8GB/s which is the max zstd can do.

This PR introduces the API I need to plumb io_uring, without it being specific to io_uring.

This introduces a new Unpacker trait to the API, and new `unpack_with`
methods to Archive and Entry.

Custom unpackers can be used to abstract/optimize IO and filesystem
operations, for example by using io_uring on linux. The current/default
unpacking code is moved to DefaultUnpacker.
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.

None yet

1 participant