Crystal: Why the crystal binary is bigger that others?

Created on 10 Jul 2016  路  4Comments  路  Source: crystal-lang/crystal

The biggest in my /usr/bin

big list

Compared with other kanguages

compared

question

All 4 comments

Hi,

  1. The compiler statically links LLVM: those are 10MB. You can see this by creating a file:

``` cr
require "llvm"

LLVM.init_x86
```

Then compiling it and checking its size:

$ crystal build foo.cr du -h foo 10M foo

  1. Crystal isn't optimized to generate small binaries, and in fact, because of how it works, will specialize methods to their specific types, leading to some almost duplicated code in the final executable.

@asterite Ok, I understand.
Atom editor is also a heavy program (200mb) but I like it's features

I like Crystal and DevDocs then I did a request:
馃憠 https://trello.com/c/4NSQDrPF/322-crystal

Saludos

Many of those are either likely symlinks (GCC) or load all their code via separate libraries at runtime (Python). If you add in the cost of the external libraries, then I believe you'll find it to be larger.

Looks like the question is answered :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grosser picture grosser  路  3Comments

asterite picture asterite  路  3Comments

oprypin picture oprypin  路  3Comments

asterite picture asterite  路  3Comments

will picture will  路  3Comments