Virt-v2v binary size
... is about 5MB stripped, which is not terrible, but also not great. I wrote a trivial Perl script to try to find out what's using the space and the report is attached. Also: $ size -d v2v/virt-v2v text data bss dec hex filename 3580677 1654384 36944 5272005 5071c5 v2v/virt-v2v Main take aways are: Frametables take around 21% of the on-disk space and around 31% of the text, which is a bit surprising. These are added by the OCaml compiler in order to track which stack slots are GC roots. I think the OCaml compiler could do a lot better here and I might raise an upstream bug if I can come up with a small demonstrator. However simply reducing the amount of code linked in helps. Libguestfs bindings are the next big item. Virt-v2v links dynamically to libguestfs.so.0, but the bindings code that translates from OCaml to C and back is linked statically, and it's huge. It's particularly big because we link in every binding (libguestfs has something like 650 entry points), but we only use a handful from virt-v2v. I think we might be able to do something about this. Some OCaml standard libraries are inexplicably big (Scanf? List?!) Most of the rest is actual code in virt-v2v or common/ subdirectory code. Code in particular modules is quite compact eg. Convert_linux which does the bulk of conversion of Linux guests is 24K. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On Thu, Mar 24, 2022 at 10:12:39AM +0100, Laszlo Ersek wrote:
On 03/23/22 16:39, Richard W.M. Jones wrote:
... is about 5MB stripped, which is not terrible, but also not great.
Why does its size matter?
Containers :-( The truth is it doesn't really matter, but I was interested because this topic (specifically golang vs rust binaries) came up during a meeting and I wondered how OCaml was doing. OCaml links a runtime (GC etc) into binaries which makes the minimum size of an empty program quite large (320K). Recent versions of OCaml can dynamically link the runtime, but we disable this in Fedora/RHEL because there isn't a stable ABI between the generated native code and the runtime, and with dynamic linking you could get problems with mixing binaries and runtime causing weird crashes. So the static linked runtime is unavoidable. But it seems worth at least looking if there are easy wins. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
participants (2)
-
Laszlo Ersek -
Richard W.M. Jones