crosvm/disk
Daniel Verkamp 4abcdf6b45 disk: qcow: read table clusters in a single I/O
The previous implementation of QcowRawFile::read_pointer_table() called
read_exact() on the underlying File for each individual entry in the
table; for a typical 64KB cluster size, this would mean read() would be
called 8192 times per cluster. Similarly, read_refcount_block() would
issue 32768 individual read() calls per cluster.

Using zerocopy, we can read the whole Vec<u64> or Vec<u16> reinterpreted
as a byte slice in a single read() call, then perform endian translation
and masking in a separate loop, which should be significantly more
efficient.

Change-Id: Ia66f4b9363be63935388adaa185a31b515f47951
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5977144
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2024-10-30 00:31:03 +00:00
..
src disk: qcow: read table clusters in a single I/O 2024-10-30 00:31:03 +00:00
Cargo.toml