mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 10:32:10 +00:00
ca6562849b
Using generic code for the whole vhost-user processing loop results in the same code being instantiated per-device, which turns out to be quite a bit of code just to avoid a few virtual calls on the VhostUserBackend interface. Let's make DeviceRequestHandler work with boxed VhostUserBackend trait objects instead and avoid generating that much code. With this patch, the size of the crosvm binary obtained using $ cargo build --profile chromeos && strip target/chromeos/crosvm && ls -l target/chromeos/crosvm Goes from 6577240 to 6249560 bytes, i.e. a reduction of 320KB, of ~5% of the binary size. BUG=b:217480043 TEST=vhost-user console device works. Change-Id: I1cc48404b0eb72a38aeff48bf6731d858cae9349 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3702779 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Alexandre Courbot <acourbot@chromium.org> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |