servo
servo copied to clipboard
Why are Servo builds 31MB MacOS, 84MB Linux, 102MB Windows?
Is the large discrepancy due to polyfilling missing or unshimmed platform features via wholesale re-implementations & crate dependencies?
Are Linux and Windows builds ever expected to approach the size of MacOS (presumably the first-class platform)?
Would build size parity be a good meta-bug for any needed shimming work?
thanks!
Linux and macOS ship with a large number of libraries that we depend on. On Windows, we have to ship those libraries with Servo. One example of this is OpenSSL.
We should try and get this down if we can. Certainly things like replacing freetype with DirectWrite will help. OpenSSL can possibly be replaced with SecureChannel, etc.
It would probably be worthwhile to have a metabug if someone was going to go through the libs we need and figure out what needs to be done.
A windows OpenSSL binary is a couple megs; probably not worth the effort. Freetype binaries for Windows are ~1MB [1].
That leaves 67MB of "something". It'd be good to see a breakdown of which dependency rabbit holes are heaviest to prioritize efforts.
[1] https://github.com/ubawurinna/freetype-windows-binaries/tree/master/x64
A few things you can do to start the investigation:
- Compare rlib sizes for the dependencies. Mostly we statically link everything. If rlibs are bigger on Windows than on other platforms, then maybe this points us to a compiler issue.
- Compare all the DLLs we include with the Servo binary.
- Check whether the
-msvc
target produces similarly sized executables. Perhaps this is just the static linking of all the MSYS2 crap into the binary.
@metajack thanks for the pointers
The MSVC version are 40MB.
So this looks like mingw bloat, which will be going away. That puts linux as the long pole now :)
are there any working MSVC builds/nightlies to try out or is everything still blocked on https://github.com/servo/servo/issues/12125?
I believe we have fonts working now, so in theory we should switch over to -msvc
nightlies I think. @larsbergstrom is there anything blocking us?
msvc build are running and show things
@metajack the only thing blocking us is having buildbot support. I've been focused on Android and have let https://github.com/servo/saltfs/pull/491 rot, unfortunately, but will get back on it once Android is online. Android's a priority because people keep breaking it (it just broke again), so the race of fixing all the submodules and getting buildbot enabled before somebody breaks it again is pretty brutal.
Windows has appveyor on both platforms, and people care more about it :-)
@larsbergstrom any further progress on this now that https://github.com/servo/saltfs/pull/491 is merged?
@leeoniya No progress, but at this point we should be able to minimize the set of files that are included in the MSVC MSI. Right now, we drag in all the same binaries on both, even though the MSVC version clearly doesn't need all those GNU bits :-)
On x86_64 archlinux, I got 226MB for release, 544MB debug. Trying to investigate.
Using https://github.com/google/bloaty on linux:
VM SIZE FILE SIZE
-------------- --------------
0.0% 0 .debug_info 93.5Mi 41.4%
0.0% 0 .debug_loc 37.7Mi 16.7%
56.3% 30.7Mi .text 30.7Mi 13.6%
0.0% 0 .debug_str 12.7Mi 5.6%
0.0% 0 .debug_ranges 11.6Mi 5.1%
18.3% 9.96Mi .data 9.96Mi 4.4%
0.0% 0 .strtab 5.82Mi 2.6%
0.0% 0 .debug_line 4.93Mi 2.2%
0.0% 0 .symtab 3.63Mi 1.6%
5.5% 2.98Mi .rodata 2.98Mi 1.3%
5.3% 2.89Mi .rela.dyn 2.89Mi 1.3%
5.2% 2.81Mi .eh_frame 2.81Mi 1.2%
4.3% 2.35Mi .gcc_except_table 2.35Mi 1.0%
3.1% 1.71Mi .data.rel.ro 1.71Mi 0.8%
0.0% 0 .debug_abbrev 1.02Mi 0.5%
0.9% 479Ki .eh_frame_hdr 479Ki 0.2%
0.7% 387Ki .data.rel.ro.local 387Ki 0.2%
0.2% 111Ki [Other] 365Ki 0.2%
0.0% 0 .debug_aranges 241Ki 0.1%
0.2% 139Ki .bss 0 0.0%
0.0% 15 [None] 0 0.0%
100.0% 54.5Mi TOTAL 225Mi 100.0%
Without the debug symbols, the size goes down to 54MiB. Can't compare with Mac/Win since I don't have it :(
Looking at the current numbers the Windows build is now down to 27 MB. The Linux build has increased slightly to 85 MB however.
Is there anything to do in this issue? Should it be repurposed in an issue that says we should decrease the binary size in general?
Cc @metajack
Related: https://github.com/servo/servo/issues/18625
New numbers 133 MB on MacOS, 155 MB on Linux, and 133 MB on Windows.