# Some questions about Numba behavior

**URL:** <https://numba.discourse.group/t/some-questions-about-numba-behavior/950>\
**Category:** Community Support\
**Created:** [October 6, 2021, 1:08pm UTC](https://numba.discourse.group/t/some-questions-about-numba-behavior/950 "2021-10-06T13:08:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![L.A](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@L.A](https://numba.discourse.group/u/L.A)\
**Post date:** [October 6, 2021, 1:08pm UTC](https://numba.discourse.group/t/some-questions-about-numba-behavior/950/1 "2021-10-06T13:08:23Z")

</div>

Hi,  
I’m new to Numba and started with some simple operations.

I have some questions about Numba compile process and caching:

1. I discover that when calling first time to a jit function, Numba takes more time to compile it.  
I guess that in that time Numba load it self to the memory or something alike.  
I think that a loading numba function, is not exists, but isnt it worth building one ?

2. Any successive call to jitted function will be really quick.  
I think its not because of caching, but rather Numba stores the compiled function somewhere…  
Can anyone shed some light on what is Numba behavior ?  
Does Numba keep the compiled code ? where and for how long ?

3. Modified

P.S  
This is really a great tool, Thanks !

---

<div class="post-metadata">

**Author:** ![gmarkall](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/gmarkall/32/42_2.png) [@gmarkall](https://numba.discourse.group/u/gmarkall)\
**Post date:** [October 18, 2021, 9:48am UTC](https://numba.discourse.group/t/some-questions-about-numba-behavior/950/2 "2021-10-18T09:48:21Z")

</div>

1. Perhaps `cache=True` is what you’re looking for? [Compiling Python code with @jit — Numba 0.55.0.dev0+438.g3131959c9.dirty-py3.7-linux-x86\_64.egg documentation](https://numba.readthedocs.io/en/latest/user/jit.html?highlight=cache#cache)
2. Numba does store the compiled function - it stores a separate version for each set of argument types, and if the function is called with a set of argument types that has already been compiled before, it will use the compiled version from the cache. These cached versions exist in a Dispatcher object, which is what is obtained when you decorate a function with `@jit`. The compiled versions last for the lifetime of the dispatcher - as long as it is in scope somewhere, the compiled versions exist. When it goes out of scope everywhere (e.g. if a new function with the same name is defined) then the compiled versions will cease to exist.
