Hi! On Sat, 2024-12-28 at 20:28:30 +0100, Gioele Barabucci wrote: > There is a possible related, but independent, optimization that has the > chance to significantly reduce dpkg install's time up to 90%. > > There is PoC patch [1,2] to teach dpkg to reflink files from data.tar > instead of copying them. With no changes in semantics or FS operations, the > time to install big packages like linux-firmware goes down from 39 seconds > to 6 seconds. The use of reflink would have no adverse consequences for > users of ext4, but it would greatly speed up package installation on XFS, > btrfs and (in some cases) ZFS.
I've not closed that bug report yet, because I've been meaning to ponder whether there is something from the proposal there that could be used to build upon. And whether supporting that special case makes sense at all. Unfortunately as it stands, that proposal requires for .debs to have been fsync()ed beforehand (by the frontend or the user or something), for the data.tar to not be compressed at all, and introduces a layer violation which I think makes the .deb handling less robust as I think would make the tar parser trip over appended ar members after the data.tar for example. Part of the trick here is that the fsync()s are skipped, but I think even if none of the above were problems, then we'd still need to fsync() stuff to get the actual filesystem entries to make sense, so the currently missing directory fsync()s might be a worse problem for such reflinking than the proposed disabled file data fsync()s in the patch. But I've not checked how reflinking interacts in general with fsync()s, etc. Thanks, Guillem