# How to Make Precompiling Faster?

**URL:** https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865
**Category:** General Usage
**Tags:** question
**Created:** [July 21, 2023, 4:52am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865 "2023-07-21T04:52:23Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 21, 2023, 4:52am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/1 "2023-07-21T04:52:23Z")

</div>

I add InteractiveDynamics and the precompilation of OrdinaryDiffEq took 5 hours. What are required to make the precompiling fast? high RAM or internet connection or processor power?

 ![Capture d’écran_2023-07-21_11-47-36](https://global.discourse-cdn.com/julialang/original/3X/5/3/53f65e9794359983c5a6527e475406b44ae9b80e.png)

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [July 21, 2023, 5:12am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/2 "2023-07-21T05:12:32Z")

</div>

For OrdinaryDiffEq in particular, you can ask it to not precompile the whole world using

```julia
using Preferences, UUIDs
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileNonStiff" => false, "PrecompileStiff" => false, "PrecompileAutoSwitch" => false, "PrecompileAutoSwitch" => false, "PrecompileDefaultSpecialize" => false, "PrecompileAutoSpecialize" => false, "PrecompileFunctionWrapperSpecialize" => false, "PrecompileNoSpecialize" => false)

```

see

[https://docs.sciml.ai/DiffEqDocs/latest/features/low\_dep/](https://docs.sciml.ai/DiffEqDocs/latest/features/low_dep/)

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [July 21, 2023, 5:56am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/3 "2023-07-21T05:56:26Z")

</div>

5 hours does seem unusually long, though. Maybe it’d help to specify Julia version, OS, and maybe hardware specs? If you’re wondering about internet connection, maybe someone knows how Pkg.add times its downloads among the precompilation work.

---

<div class="post-metadata">

### Author: ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)
#### Post date: [July 21, 2023, 8:32am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/4 "2023-07-21T08:32:15Z")

</div>

If it’s 5 hours, there is something wrong. On my machine it’s typically under 5 minutes. Which is still long, of course, but on a different scale.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [July 21, 2023, 9:29am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/5 "2023-07-21T09:29:42Z")

</div>

I timed @time Pkg.add(“InteractiveDynamics”) this morning. Agree with Tim Holy on the time. I can repeat and give exact time.  
This is on a laptop running Fedora.  
Are you very constrained in resources on your machine? Maybe low on rAM and swapping is happening?

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [July 21, 2023, 9:59am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/6 "2023-07-21T09:59:18Z")

</div>

Although we have had other people on here before who had what initially looked like suspicious compile times where it then turned out they were on some really old single threaded i3 CPU or something, so maybe the ouptut of `versioninfo()` would help to understand what’s going on.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [July 22, 2023, 5:49am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/7 "2023-07-22T05:49:02Z")

</div>

Please report versioningo() and your @time output

Also look at this thread

> [@PackageCompiler compilation time \> 2h](https://discourse.julialang.org/t/packagecompiler-compilation-time-2h/101910/10):
>
> 8Gbytes is not a lot of RAM these days but should be enough. I would advise openign a new terminal and running these utilities as the compilation is happening top htop iotop Often a simple ‘top’ will give you insight into what is going on.

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 22, 2023, 5:49am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/8 "2023-07-22T05:49:30Z")

</div>

This is the versioninfo of Julia 1.9.2, processor is core i7, RAM is 16 GB.

Maybe the internet is very slow. I only get slow signal internet here. Furthermore, Maybe because I have added packages that requires a lot of power like InteractiveDynamics, DynamicalBilliards,…

 ![Capture d’écran_2023-07-22_12-46-49](https://global.discourse-cdn.com/julialang/original/3X/2/b/2bf78e73acaded860abd53a9caf09dc1c9832b98.png)

I will use `@time` and share the time. Precompiling after long hours here usually fails.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [July 22, 2023, 6:05am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/9 "2023-07-22T06:05:23Z")

</div>

Hm, I’ve never seen that CPU bit a quick Google suggests it might be quite old?

What do you get when you precompile a smaller package, say DataFrames?

If you struggle with precompile times it might be good to switch to 1.10 alpha if you can, which reduces precompile times (albeit not by 5 hours unfortunately…)

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 22, 2023, 6:21am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/10 "2023-07-22T06:21:34Z")

</div>

My laptop is using Custom Linux OS in QEMU to try this Julia

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [July 22, 2023, 6:23am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/11 "2023-07-22T06:23:32Z")

</div>

I would suggest opening a new ssh session to this VM and running top or htop as you run Julia.  
top can be surprisingly useful in revealing problems.

How much RAM does this VM have allocated?

---

<div class="post-metadata">

### Author: ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)
#### Post date: [July 22, 2023, 6:28am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/12 "2023-07-22T06:28:19Z")

</div>

> [@nilshg](#):
>
> Hm, I’ve never seen that CPU bit a quick Google suggests it might be quite old?

Very. Doesn’t even have AVX.  
It is the second Intel Core processor. Latest release is the thirteenth generation.

Still, 5 hours sounds extreme. Like others noted, sounds like it could be swapping on a HDD.

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 23, 2023, 5:04am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/13 "2023-07-23T05:04:02Z")

</div>

I will try your suggestion, I allocate 16 GB now. Fully.

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 23, 2023, 5:05am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/14 "2023-07-23T05:05:15Z")

</div>

DataFrames is quick around 10 minutes, my laptop is not a sophisticated laptop, old Dell Precision.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [July 23, 2023, 7:41am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/15 "2023-07-23T07:41:32Z")

</div>

Okay in that case it does look like your system is just very slow, I just precompiled DataFrames on a 10 year old i5 system and it took a little over one minute.

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 23, 2023, 9:20am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/16 "2023-07-23T09:20:19Z")

</div>

I just add SciMLTutorials and the time is 11342 seconds / 189.0333 minutes, I learn to be patience with this (in the main OS: CAELinux 2020 not inside Qemu, with the same Dell Precision Laptop Julia version 1.9.0)

![Capture d’écran_2023-07-23_16-11-05](https://global.discourse-cdn.com/julialang/original/3X/f/2/f22f77341556e64ceea6d722f4ecdfb5d9228f21.png)

![Capture d’écran_2023-07-23_16-05-18](https://global.discourse-cdn.com/julialang/original/3X/4/f/4f786af2c791e0220737562b385da871879f06bd.png)

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [July 23, 2023, 9:26am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/17 "2023-07-23T09:26:09Z")

</div>

I think it’s a sad fact of life that on very underpowered hardware precompilation is a real pain, especially in 1.9. If you can I would use the recently released 1.10 alpha, which addresses some of the large increase in precompile times in 1.9.

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [July 23, 2023, 9:48am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/18 "2023-07-23T09:48:42Z")

</div>

> [@Freya\_the\_Goddess](#):
>
> high RAM or internet connection or processor power?

Just occurred to me, we _can_ measure internet connection. When you Google “test internet connection”, it offers you a free test from the Measurement Lab. There is a privacy policy you should read to see if you’re okay with them collecting data, including your IP address. If you are okay with that, then it’s just hitting a button and letting a test run until it gives you 2 numbers. For example, when I run it on my machine and home internet, I get 379.4 Mbps download rate and 39.4 Mbps upload rate. We could check and compare to see if it’s a download speed issue.

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 26, 2023, 4:43am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/19 "2023-07-26T04:43:29Z")

</div>

Yes I am downloading Julia-1.10 alpha.

I will use this new version for the Differential Equations package,  
I add `OrdinaryDiffEq` 3 days ago, wait for hours, then there is this warning of `NeuralPDE`:  
(wait for 28019 seconds or 466.983 minutesor around 7 hours )

 ![Capture d’écran_2023-07-25_04-20-56](https://global.discourse-cdn.com/julialang/original/3X/d/5/d54e96d0b1f808f3aba1a33783131642c9cdc3b6.png)

Then anytime I add another package like `DiffEqSensitivity` it takes a long time to precompile `OrdinaryDiffEq`, in fact just now I try to add again `OrdinaryDiffEq`, it has to precompiling again, why?

This is the package I have downloaded for days I have to wait

 ![Capture d’écran_2023-07-26_11-38-18](https://global.discourse-cdn.com/julialang/original/3X/3/6/36c056c35fee16b5650a36d8054d10dabc02e9ae.png)

Thanks for your patience and answers

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [July 26, 2023, 4:49am UTC](https://discourse.julialang.org/t/how-to-make-precompiling-faster/101865/20 "2023-07-26T04:49:44Z")

</div>

There are lots of ways to Rome, I click the Measurement Lab button, it hasn’t comes with result, so I just use this:

 ![Capture d’écran_2023-07-26_11-47-46](https://global.discourse-cdn.com/julialang/original/3X/5/6/563dacc35bdafce47e65914a093192ee3a0b4200.png)

around 260 Kb/s, I am using slow internet connection unlike yours that can be tens or hundreds of Mb/s

 ![Capture d’écran_2023-07-26_11-47-58](https://global.discourse-cdn.com/julialang/original/3X/3/5/35e9f21f729636f13468b3eb3ee22d02044af6b9.png)
