# Is it possible to precompile a function in Julia?

**URL:** https://discourse.julialang.org/t/is-it-possible-to-precompile-a-function-in-julia/86578
**Category:** Performance
**Tags:** precompilation, function
**Created:** [August 31, 2022, 12:23am UTC](https://discourse.julialang.org/t/is-it-possible-to-precompile-a-function-in-julia/86578 "2022-08-31T00:23:31Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [August 31, 2022, 3:28am UTC](https://discourse.julialang.org/t/is-it-possible-to-precompile-a-function-in-julia/86578/2 "2022-08-31T03:28:38Z")

</div>

1. Precompilation only speeds up code loading (i.e. startup time), not runtime performance. All Julia functions are compiled the first time you call them (with a particular set of argument types), and thereafter are fast.

2. Precompilation is something that happens for code that you put into a package, which you should do for any longer-term development effort in Julia. See also [Best practise: organising code in Julia - #2 by stevengj](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362/2)

---

_[View the full topic](https://discourse.julialang.org/t/is-it-possible-to-precompile-a-function-in-julia/86578)._
