# Released version vs. source compiled - optimizations?

**URL:** https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329
**Category:** Internals & Design
**Tags:** question
**Created:** [January 31, 2021, 3:13pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329 "2021-01-31T15:13:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)
#### Post date: [January 31, 2021, 3:13pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329/1 "2021-01-31T15:13:44Z")

</div>

One “bug” I recently found appears to differ between the packaged and released version of Julia and the one I compile from source.

[Extra allocations associated with unused ArgumentError · Issue #37639 · JuliaLang/julia (github.com)](https://github.com/JuliaLang/julia/issues/37639)

Are there extra optimizations turned on for the final build that aren’t used by default for development? And if so, should it affect the example there, or is it unintended and something to address?

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [January 31, 2021, 3:39pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329/2 "2021-01-31T15:39:56Z")

</div>

The locally built version uses a `CPU_TARGET` of `native` while Julia itself uses `"generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"` (see [System Image Building · The Julia Language](https://docs.julialang.org/en/v1/devdocs/sysimg/#Specifying-multiple-system-image-targets)).

Whether that is the cause of the difference, I don’t know.

---

<div class="post-metadata">

### Author: ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)
#### Post date: [January 31, 2021, 6:37pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329/3 "2021-01-31T18:37:45Z")

</div>

I’m not seeing a difference, but also not sure if I did it right.

```julia
make JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"

```

?

---

<div class="post-metadata">

### Author: ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)
#### Post date: [January 31, 2021, 6:56pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329/4 "2021-01-31T18:56:13Z")

</div>

Nevermind, I guess whatever it was, after 1.5.2-pre.29, wasn’t kept in for 1.5.3 but is in for 1.6.0?

1.6.0-beta1, the released version, _does_ have the behavior. Unless there’s also a difference between beta and full release? 🙃

---

<div class="post-metadata">

### Author: ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)
#### Post date: [January 31, 2021, 7:36pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329/5 "2021-01-31T19:36:29Z")

</div>

> [@BioTurboNick](#):
>
> 1.6.0-beta1, the released version, _does_ have the behavior. Unless there’s also a difference between beta and full release?

What do you mean by full release? Are you building from the master or the release-1.6 branch?

---

<div class="post-metadata">

### Author: ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)
#### Post date: [January 31, 2021, 8:26pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329/6 "2021-01-31T20:26:04Z")

</div>

The copy of 1.6.0-beta1 from [Download Julia](https://julialang.org/downloads/) has the behavior I noted (unnecessary allocations), as does the copy I build from the `master` branch of the repository with `make`.

But I may have mislead myself on the cause. It sounds like it’s related to a change that was made to compiling throw blocks in the 1.6 branch.

---

<div class="post-metadata">

### Author: ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)
#### Post date: [January 31, 2021, 9:32pm UTC](https://discourse.julialang.org/t/released-version-vs-source-compiled-optimizations/54329/7 "2021-01-31T21:32:40Z")

</div>

Note that the 1.6 beta gets built off the `release-1.6` branch, not the latest `master` branch. Once 1.6 was branched off, only bug fixes are backported to `release-1.6`, so if you observe any differences between the two, that’s most likely due to this, not the way it was built. You can download nightlies from the website as well, which always get built off the current `master` branch.
