... 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
Report on v2v/virt-v2v
----------------------

Frametables               1104208
OCaml internal stuff      249892
Libguestfs internal       16587
Libguestfs bindings       247829
Libvirt bindings          46257
Libnbd bindings           40709
Unknown                   46869

Modules (largest first)
Guestfs                   202547
Stdlib.Scanf              45704
Convert_linux             24550
Libvirt                   24244
Std_utils                 22950
V2v                       20684
Create_ovf                20493
Tools_utils               20443
Str                       17921
Stdlib.List               17265
Unix                      17002
Stdlib.Array              15136
Stdlib.Set                13703
Stdlib.Hashtbl            13415
Stdlib.Map                12642
Create_libvirt_xml        12346
Convert_windows           12215
Stdlib.Bytes              11412
Windows_virtio            10513
Stdlib.Filename           10465
Linux_bootloaders         10193
Output_rhv_upload         9801
Parse_libvirt_xml         9598
OVA                       9366
Create_json               9251
Output_openstack          8727
Stdlib.Buffer             8155
Firstboot                 7587
Stdlib                    7471
Parse_domain_from_vmx     7435
Output_qemu               6970
Linux_kernels             6688
Gettext                   6551
NBD                       6371
Stdlib.Printexc           5927
Stdlib.String             5794
Parse_vmx                 5677
Inspect_source            5383
Utils                     5000
Convert                   4847
Output_rhv                4790
Types                     4679
OVF                       4458
Output_vdsm               4226
Nbdkit                    4087
Getopt                    3974
Stdlib.Random             3878
Linux                     3835
Output_libvirt            3775
Input_ova                 3481
Input_vddk                3443
VCenter                   3204
Nbdkit_vddk               3115
Stdlib.Parsing            3009
DOM                       2825
Stdlib.Lexing             2810
Output_json               2711
QemuNBD                   2478
UnixLabels                2380
Input_libvirt             2347
Stdlib.Obj                2298
Libosinfo_utils           2261
Nbdkit_ssh                2166
Output_glance             2062
JSON                      2009
Stdlib.Seq                1980
Libvirt_utils             1948
JSON_parser               1932
Input_disk                1908
Stdlib.Gc                 1832
Registry                  1802
Networks                  1789
On_exit                   1756
Xml                       1730
Curl                      1697
Input_vcenter_https       1640
Input_vmx                 1629
Changeuid                 1626
GettextTypes              1603
Input_xen_ssh             1560
Target_bus_assignment     1524
GettextCompat             1481
Output                    1468
Stdlib.Nativeint          1447
Stdlib.Int64              1436
Output_disk               1392
Checksums                 1370
Stdlib.Int32              1359
SELinux_relabel           1352
Stdlib.Digest             1329
Openstack_image_properties  1317
GettextModules            1294
GettextStub               1293
Nbdkit_curl               1267
Windows                   1254
Regedit                   1252
Var_expander              1234
PCRE                      1119
Stdlib.Sys                1051
Libosinfo                 976
Output_null               950
Xpath_helpers             910
GettextFormat             893
Python_script             871
Stdlib.Printf             848
Unix_utils                838
Stdlib.Char               693
Stdlib.Fun                683
GettextFormat_parser      679
Stdlib.Uchar              666
GettextUtils              652
Tools_utils_              634
GettextCategory           607
StringMap                 601
Stdlib.Marshal            566
StringSet                 548
Qemuopts                  446
C_utils                   367
Name_from_disk            353
GettextFormat_lexer.      286
Stdlib.Int                282
GettextConfig             205
Parse_vmx_                204
Gettext.f                 199
Stdlib.Callback           173
Stdlib.Map__seq_of_enum   169
Stdlib.Map__rev_seq_of_enum  169
Gettext.s                 159
Gettext.fn                159
Gettext.sn                159
Stdlib.Set__seq_of_enum   145
Stdlib.Set__rev_seq_of_enum  145
GettextFormat_lexer       124
Common_gettext            117
Config                    112
Guestfs_config            101
Stdlib.Atomic             82
GettextConfigGen          45
Std_exit                  41
Uefi                      34
Output_rhv_upload_vmcheck_source  23
Output_rhv_upload_plugin_source  23
Output_rhv_upload_precheck_source  23
Output_rhv_upload_createvm_source  23
Output_rhv_upload_transfer_source  23
Output_rhv_upload_finalize_source  23
Output_rhv_upload_cancel_source  23
GettextStubCompat         6

Attachment: v2v-binary-size.pl
Description: Perl program

_______________________________________________
Libguestfs mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to