# Overhead between calling a function and running the first line its code

**URL:** <https://discourse.julialang.org/t/overhead-between-calling-a-function-and-running-the-first-line-its-code/93963>\
**Category:** General Usage\
**Created:** [February 2, 2023, 11:57pm UTC](https://discourse.julialang.org/t/overhead-between-calling-a-function-and-running-the-first-line-its-code/93963 "2023-02-02T23:57:30Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [February 4, 2023, 1:56pm UTC](https://discourse.julialang.org/t/overhead-between-calling-a-function-and-running-the-first-line-its-code/93963/6 "2023-02-04T13:56:48Z")

</div>

> [@mkitti](#):
>
> Do not exit Julia.

There are several cases:

1. You are doing interactive exploration. Solution: use an interactive environment (the REPL, a Jupyter notebook, vsCode, Pluto, …) in which you leave Julia running. (For larger-scale code development, do this in conjunction with Revise.jl by creating a package. See [Best practise: organising code in Julia - #2 by stevengj](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362/2))
2. Your function `main()` is extremely fast, but you are calling it lots of times. Solution: write your loop _in Julia_ — don’t write a shell script or something. (If you are doing benchmarking, use [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl).)
3. Your function `main()` takes a long time (minutes, hours, …). Solution: use separate Julia runs if you want. The compile time will be irrelevant.

---

_[View the full topic](https://discourse.julialang.org/t/overhead-between-calling-a-function-and-running-the-first-line-its-code/93963)._
