# Will the use of \`@code\_native\` compile and cache function?

**URL:** <https://discourse.julialang.org/t/will-the-use-of-code-native-compile-and-cache-function/63534>\
**Category:** General Usage\
**Created:** [June 25, 2021, 7:25am UTC](https://discourse.julialang.org/t/will-the-use-of-code-native-compile-and-cache-function/63534 "2021-06-25T07:25:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mobius-eng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mobius-eng/32/99_2.png) [@mobius-eng](https://discourse.julialang.org/u/mobius-eng)\
**Post date:** [June 25, 2021, 7:25am UTC](https://discourse.julialang.org/t/will-the-use-of-code-native-compile-and-cache-function/63534/1 "2021-06-25T07:25:29Z")

</div>

I want to compile and cache some of the functions at the start of Julia session - I find it less disruptive compared to the slow first run. Will calling them with `@code_native` and passing dummy arguments of appropriate type do the trick? I don’t want to actually run them at this stage. Or is there another way?

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [June 25, 2021, 9:42am UTC](https://discourse.julialang.org/t/will-the-use-of-code-native-compile-and-cache-function/63534/2 "2021-06-25T09:42:45Z")

</div>

You can use `precompile(f, (tuple, of, arg, types))`
