# PackageCompiler - size

**URL:** https://discourse.julialang.org/t/packagecompiler-size/23487
**Category:** New to Julia
**Created:** [April 24, 2019, 9:41pm UTC](https://discourse.julialang.org/t/packagecompiler-size/23487 "2019-04-24T21:41:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![josemaria](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josemaria/32/5365_2.png) [@josemaria](https://discourse.julialang.org/u/josemaria)
#### Post date: [April 24, 2019, 9:41pm UTC](https://discourse.julialang.org/t/packagecompiler-size/23487/1 "2019-04-24T21:41:26Z")

</div>

I was playing with PackageCompiler. I managed to create shared and static libraries for a simple piece of code:

```julia
open("/tmp/borrame.txt", "w") do f
    write(f, "A, B, C, D\n")
end

f(x) = x < 20 ? true : false
print(f(3))
print(f(22))

```

I was surprised about the size 130M for the shared library.

Will it always be like that or is it a matter of time getting to more reasonable sizes?

I was playing with go and I just love how easy and fast it is to run `go run file.go` or compile `go build file.go`, getting a single file for the whole project. On the other hand it is really nice having a REPL.

Regards,  
José M.

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [April 26, 2019, 5:29pm UTC](https://discourse.julialang.org/t/packagecompiler-size/23487/2 "2019-04-26T17:29:40Z")

</div>

What PackageCompiler does is it recompiles the Julia sysimg (sys.so) with your package/functions compiled on top. Since the Julia sysimg is about 130MB, that’s almost definitely what you’re seeing.

There is a branch of Julia in the works to potentially avoid the need to load the sysimg when we don’t want to pull in all that stuff, just to compile a simple (mostly static) binary: [julia/test/standalone-aot at standalone-mode · tshort/julia · GitHub](https://github.com/tshort/julia/tree/standalone-mode/test/standalone-aot)

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [April 26, 2019, 5:33pm UTC](https://discourse.julialang.org/t/packagecompiler-size/23487/3 "2019-04-26T17:33:28Z")

</div>

Do note that using IO (`print`, `open`) requires libuv and the Task runtime, which itself might be rather heavy and hard to separate from the rest of libjulia without terribly breaking language symantics. I previously proposed having the option to replace libuv-provided IO with simpler libc-provided IO (which has very different but well-known semantics), which would be useful where you’re okay with blocking IO and such.

---

<div class="post-metadata">

### Author: ![josemaria](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josemaria/32/5365_2.png) [@josemaria](https://discourse.julialang.org/u/josemaria)
#### Post date: [April 26, 2019, 9:27pm UTC](https://discourse.julialang.org/t/packagecompiler-size/23487/4 "2019-04-26T21:27:38Z")

</div>

Thanks for the information. Really encouraging.
