StaticCompiler.jl icon indicating copy to clipboard operation
StaticCompiler.jl copied to clipboard

Binary doubled in size

Open PallHaraldsson opened this issue 2 years ago • 2 comments

In in example docs (used the code there):

shell> ls -alh hello
-rwxrwxr-x. 1 user user 8.4K Oct 20 20:36 hello

in my case:
shell> ls -alh hello
-rwxrwxr-x 1 pharaldsson pharaldsson 16K maí 19 16:39 hello

Is it known why? I used 1.9.0, the possible reason?

PallHaraldsson avatar May 19 '23 16:05 PallHaraldsson

So I think this varies somewhat widely as a function of OS and architecture. That example was run on an intel mac; linux gave slightly larger binaries IIRC, and on my current arm mac the same example weighs in at 33k. It's possible that binary size also changed as a function of something in this package, but one would have to run a systematic comparison to be sure.

If we generally want to prioritize binary size, there are likely compiler flags we could specify on e.g. this line https://github.com/tshort/StaticCompiler.jl/blob/51db924b140593cb31aea1f386e139940a1402ea/src/StaticCompiler.jl#L497or via the cflags kwarg. If you want to experiment with this it could be a nice thing to add to the docs!

brenhinkeller avatar May 19 '23 17:05 brenhinkeller

I can look into it a bit. It's not a huge priority to me or anyone, likely a fixed overhead.

PallHaraldsson avatar May 19 '23 18:05 PallHaraldsson