Why is the compiled file size so huge?

user1234 user1234 at 12.dr
Sat May 28 11:23:11 UTC 2022


On Friday, 27 May 2022 at 13:40:25 UTC, Alexander Zhirov wrote:
> I'm trying to compile a file that weighs 3 kilobytes. I'm also 
> linking a self-written dynamic library. I don't understand why 
> the resulting executable file is so huge? After all, all 
> libraries are present:
>

I'd take a look with IDA or hydra to check the details (maybe 
something is statically linked after all, that should be visible 
by inspecting the names view) but one thing to understand in a 
first time is that

1. even if druntime and phobos are dynamic libraries all the 
template instances are generated in your binary.
2. use of some module has for effect to create huge static 
tables. I think to all the UTF stuff and also std regex.


More information about the Digitalmars-d-learn mailing list