# How to write scripts with quick startup time (PackageCompiler.jl?)

**URL:** <https://discourse.julialang.org/t/how-to-write-scripts-with-quick-startup-time-packagecompiler-jl/53900>\
**Category:** General Usage\
**Created:** [January 25, 2021, 11:13am UTC](https://discourse.julialang.org/t/how-to-write-scripts-with-quick-startup-time-packagecompiler-jl/53900 "2021-01-25T11:13:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [January 25, 2021, 11:13am UTC](https://discourse.julialang.org/t/how-to-write-scripts-with-quick-startup-time-packagecompiler-jl/53900/1 "2021-01-25T11:13:02Z")

</div>

I’d like to use Julia to write some scripts for quick tasks that could be otherwise done with Bash, sed, etc. Is there a good way to precompile the script to make it start quickly? Is PackageCompiler.jl a good option, and if so, what’s a recommended way to use it?

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [January 25, 2021, 1:02pm UTC](https://discourse.julialang.org/t/how-to-write-scripts-with-quick-startup-time-packagecompiler-jl/53900/2 "2021-01-25T13:02:25Z")

</div>

I would first recommend you try your script while passing the `-O0 --compile=min` flags to Julia and check how the times change. If your script is more IO-bound than CPU-bound then this should be enough. If your script does a lot of computational effort, then [DaemonMode](https://discourse.julialang.org/t/ann-daemonmode-jl-a-package-to-run-faster-scripts-in-julia/42384) can help you (the first run will be yet slow, but every other run will be faster). I would turn to `PackageCompiler.jl` as a last resort.

---

<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:** [January 25, 2021, 6:05pm UTC](https://discourse.julialang.org/t/how-to-write-scripts-with-quick-startup-time-packagecompiler-jl/53900/3 "2021-01-25T18:05:26Z")

</div>

See [`jlpkg` -- a command line interface to Pkg](https://discourse.julialang.org/t/jlpkg-a-command-line-interface-to-pkg/24077) for a very nice example
