# Optimization level when running files with include() in the REPL

**URL:** https://discourse.julialang.org/t/optimization-level-when-running-files-with-include-in-the-repl/30566
**Category:** General Usage
**Created:** [October 31, 2019, 11:20pm UTC](https://discourse.julialang.org/t/optimization-level-when-running-files-with-include-in-the-repl/30566 "2019-10-31T23:20:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aortizb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aortizb/32/6513_2.png) [@aortizb](https://discourse.julialang.org/u/aortizb)
#### Post date: [October 31, 2019, 11:20pm UTC](https://discourse.julialang.org/t/optimization-level-when-running-files-with-include-in-the-repl/30566/1 "2019-10-31T23:20:21Z")

</div>

I know from the user manual that:

```julia
julia -O -- file.jl

```

has a default optimization level of 3.

I have few questions regarding the optimization level:

If “file.jl” is run in the REPL using:

```julia
include("file.jl")

```

1. what is the optimization level used?
2. regarding 1), can this optimization level be changed so that include(“file.jl”) is run with a specified optimization level?

Thanks!

---

<div class="post-metadata">

### Author: ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)
#### Post date: [November 2, 2019, 12:30am UTC](https://discourse.julialang.org/t/optimization-level-when-running-files-with-include-in-the-repl/30566/2 "2019-11-02T00:30:15Z")

</div>

As far as i know, the optimization level is attached to the julia process, not the source file.

If you run `julia -O3 file.jl`, then all the code in `file.jl` will be compiled with the `-O3` optimization level.

Likewise, if you run `julia -O3`, and then in the REPL:

```julia
include("file.jl")

```

the code in `file.jl` will also be compiled with the `-O3` optimization level.

  

I do not know of any way to dynamically or temporarily change the optimization level of a running Julia process / REPL.
