-
Notifications
You must be signed in to change notification settings - Fork 14
Description
cfsctl oci pull
is kinda slow right now.
When converting the container image .tar.gz
into splitstreams it does the gzip decompression, sha256 verification (of the underlying .tar
), fs-verity calculations (of the split objects), fdatasync()
(of the split objects), zstd compression of the splitstream, and finally fs-verity and fdatasync()
of the splitstream, all in a single thread.
mkcomposefs
is smarter here: it spawns a bunch of worker threads to do the fs-verity and fdatasync() on the split objects.
This would be pretty easy for us to do, and Rust would help us make sure we're doing it right, except the way that splitstreams are currently constructed is pretty linear: you need to get the object ID of each object to write into the stream before you can proceed to the next one. But: we're just writing to a Vec<u8>
anyway, so we can easily go back in fill those parts in, or come up with some kind of a "chunks" model where we merge all the chunks into the linear stream at the end, or any other design. We could then make some of the chunks be promises or something — I'm really not sure how this works in Rust...