# Running a function is extremely slow

**URL:** <https://discourse.julialang.org/t/running-a-function-is-extremely-slow/53475>\
**Category:** General Usage\
**Created:** [January 17, 2021, 8:10am UTC](https://discourse.julialang.org/t/running-a-function-is-extremely-slow/53475 "2021-01-17T08:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheng\_chen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cheng_chen/32/20899_2.png) [@cheng\_chen](https://discourse.julialang.org/u/cheng_chen)\
**Post date:** [January 17, 2021, 8:10am UTC](https://discourse.julialang.org/t/running-a-function-is-extremely-slow/53475/1 "2021-01-17T08:10:46Z")

</div>

I wrote a Julia function and on the first line inside the function, I had a print statement. After I call the function in REPL, It takes a long time for it to get to the first line of the function. Does anyone know what the issue is?

PS: the function used JuMP in later lines, I don’t know if it has anything to do with this.

---

<div class="post-metadata">

**Author:** ![roflmaostc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roflmaostc/32/30123_2.png) [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Post date:** [January 17, 2021, 9:32am UTC](https://discourse.julialang.org/t/running-a-function-is-extremely-slow/53475/2 "2021-01-17T09:32:59Z")

</div>

Can you provide a minimal working example?  
Normally print statements should be printed quickly after calling a simple function, right?

And are you aware of that the first call includes the compiling overhead? What happens if you call it a second time?
