[LLVMdev] Why are LLVM libraries enormous?

Óscar Fuentes ofv at wanadoo.es
Tue Jul 27 16:11:34 PDT 2010


David Piepgrass <dpiepgrass at mentoreng.com> writes:

>> Comparing the size of the static libraries makes little sense, and even
>> less when they are compiled by different tools. What really matters is
>> the size of the executables.
>> 
>> I agree that LLVM can be considered a heavyweight dependency on this
>> aspect.
>
> Why is the size of static libraries a "nonsensical" topic of
> discussion?

Why do you care about the size of library files?

> Anyway, in the same example I mentioned that the size of HowToUseJIT
> (an executable) is very large (15.4 MB debug, 3.4 MB release); as is a
> small example, I'd expect any real-world executable to be larger.

Of course a real-world project would be larger, but not on a "linear"
proportion compared to HowToUseJIT. That example application pulls a big
chunk from the LLVM libraries. That is what makes it large, not the code
in howtousejit.cpp. My compiler, for instance, is anything but a toy
application and is 5.7 MB.

> I think it's fair to wonder what makes it is so large, why MacOS seems
> to get different results,

If you want to compare sizes, you must limit your comparisons to
executable files. Why would be relevant that XCode produces library
files smaller than Visual Studio? Its comparing apples to oranges.

> and whether it is possible to construct an example less than 1 MB.

A LLVM JIT compiler for x86 under 1 MB? I doubt it is possible without a
major rewriting of LLVM.




More information about the llvm-dev mailing list