# JIT Performance for Single-Run Scripts

**URL:** https://discourse.julialang.org/t/jit-performance-for-single-run-scripts/21948
**Category:** New to Julia
**Created:** [March 16, 2019, 9:08pm UTC](https://discourse.julialang.org/t/jit-performance-for-single-run-scripts/21948 "2019-03-16T21:08:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tjb](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@tjb](https://discourse.julialang.org/u/tjb)
#### Post date: [March 16, 2019, 9:08pm UTC](https://discourse.julialang.org/t/jit-performance-for-single-run-scripts/21948/1 "2019-03-16T21:08:56Z")

</div>

I’m new to Julia (coming from Python), but I like what I see. However, I do have what may be a dumb question. Forgive me if it is.

I have a single file that I want to run from the command line with something like: `sh> julia file.jl infile.csv` that uses DataFrames to manipulate data and saves it out. It seems that each time the JIT is running and it is painfully slow. I know if I run the code one time then it will compile and be faster on subsequent runs, but in some situations, I don’t want to run my code twice.

What am I missing? I know it must be pretty simple, but I don’t know where to look for guidance.

TJB

---

<div class="post-metadata">

### Author: ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)
#### Post date: [March 16, 2019, 10:55pm UTC](https://discourse.julialang.org/t/jit-performance-for-single-run-scripts/21948/2 "2019-03-16T22:55:10Z")

</div>

My understanding is that there are a few efforts to improve the compile time latency. One is [PackageCompiler.jl](https://github.com/JuliaLang/PackageCompiler.jl). You might find some of this discussion about [compiler optimizations](https://discourse.julialang.org/t/compiler-work-priorities/17623) to be useful. Someone might have more update to date information about these projects.

---

<div class="post-metadata">

### Author: ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)
#### Post date: [March 17, 2019, 8:57am UTC](https://discourse.julialang.org/t/jit-performance-for-single-run-scripts/21948/3 "2019-03-17T08:57:10Z")

</div>

It’s a downside of the JIT system, which makes Julia not ideal for short command line programs. The main workaround is to change a bit your workflow. Instead of restarting Julia each time, start it once and then do `include("file.jl")` to run your analysis (or define a function and run it), so you don’t need to reload and recompile things each time.

Otherwise you can try to compile your packages as said above.

---

<div class="post-metadata">

### Author: ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)
#### Post date: [March 17, 2019, 10:34am UTC](https://discourse.julialang.org/t/jit-performance-for-single-run-scripts/21948/4 "2019-03-17T10:34:34Z")

</div>

Although it may not help you with your current problem, it’s worth mentioning that using [Revise](https://github.com/timholy/Revise.jl) is recommended for code development. It allows you to modify code without having to restart your Julia session and compile your packages again. The main limitation is that it does not currently work for structs, but there are [plans](https://github.com/timholy/Revise.jl/issues/18) to eventually incorporate this functionality.
