# Compiling Julia from source vs release binaries

**URL:** https://discourse.julialang.org/t/compiling-julia-from-source-vs-release-binaries/108180
**Category:** General Usage
**Tags:** question, juliaup
**Created:** [December 30, 2023, 10:13am UTC](https://discourse.julialang.org/t/compiling-julia-from-source-vs-release-binaries/108180 "2023-12-30T10:13:34Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [December 30, 2023, 11:24am UTC](https://discourse.julialang.org/t/compiling-julia-from-source-vs-release-binaries/108180/2 "2023-12-30T11:24:58Z")

</div>

> [@Tamas\_Papp](#):
>
> Specifically, compiling from source targets the CPU of the local machine

To be clear, that only applies to the julia runtime (e.g. garbage collector, interface to LLVM, etc.) which is written in C/C++ and the packages in the sysimage, but the code generated by the julia compiler at runtime shouldn’t be affected by how the julia executable itself was compiled, as that’s always targeting the current CPU (unless you explicitly choose a different target with `julia -C`).

> [@Tamas\_Papp](#):
>
> Am I losing any performance by using the latter, assuming a recent CPU?

Based on the previous section of my reply, if you’re losing some performance it’s mainly in julia’s runtime, not really in the JIT-generated code. Playing with LTO/PGO (which is not currently easily doable in julia anyway) showed some performance gains in terms of compilation time:

> [@Building julia with \`march=native\`](https://discourse.julialang.org/t/building-julia-with-march-native/82256/13):
>
> @ImreSamu: regarding Clear Linux and the Phoronix benchmark, you have to take it with a grain of salt. For example they have amazing numbers for Zstd, but the reason is they set the default number of threads to 4, where other distro’s only use 1; the benchmark is builtin zstd -b ..., so it’s apples and oranges ([zstd benchmark misleading · Issue #633 · phoronix-test-suite/phoronix-test-suite · GitHub](https://github.com/phoronix-test-suite/phoronix-test-suite/issues/633)). Another issue is Phoronix compares Zstd 1.4 with 1.5, and there’s huge performance improvements…

---

_[View the full topic](https://discourse.julialang.org/t/compiling-julia-from-source-vs-release-binaries/108180)._
