JuliaLang/julia — pull request #9354 by timholy (2014-12-14 12:28:42+00:00)
Title: Add --noinline startup option

Inlining (one of my favorite performance features of julia) can make debugging harder. This adds a `--noinline` startup option so you can turn it off. This was inspired by https://github.com/timholy/Images.jl/issues/232#issuecomment-66901770.

Demo (I temporarily commented out the line that fixed that issue): with regular startup,
```julia
julia> using Images, Color, FixedPointNumbers
# ambiguity warning suppressed

julia> img = Image(reinterpret(Gray{Ufixed16}, rand(Uint16, 5, 5)))
Gray Images.Image with:
data: 5x5 Array{Images.ColorTypes.Gray{FixedPointNumbers.UfixedBase{UInt16,16}},2}
properties:

julia> imgs = subim(img, :, :)
Gray Images.Image with:
data: 5x5 SubArray{Images.ColorTypes.Gray{FixedPointNumbers.UfixedBase{UInt16,16}},2,Array{Images.ColorTypes.Gray{FixedPointNumbers.UfixedBase{UInt16,16}},2},(Colon,Colon),2}
properties:

julia> map(ScaleAutoMinMax(RGB24), imgs)
ERROR: reinterpret: expected bits type as first argument
in map! at /home/tim/.julia/v0.4/Images/src/map.jl:336
in map at /home/tim/.julia/v0.4/Images/src/map.jl:311
```

With `--noinline`:
```julia
julia> using Images, Color, FixedPointNumbers
# ambiguity warning suppressed

julia> img = Image(reinterpret(Gray{Ufixed16}, rand(Uint16, 5, 5)))
Gray Images.Image with:
data: 5x5 Array{Images.ColorTypes.Gray{FixedPointNumbers.UfixedBase{UInt16,16}},2}
properties:

julia> imgs = subim(img, :, :)
Gray Images.Image with:
data: 5x5 SubArray{Images.ColorTypes.Gray{FixedPointNumbers.UfixedBase{UInt16,16}},2,Array{Images.ColorTypes.Gray{FixedPointNumbers.UfixedBase{UInt16,16}},2},(Colon,Colon),2}
properties:

julia> map(ScaleAutoMinMax(RGB24), imgs)
ERROR: reinterpret: expected bits type as first argument
in reinterpret at base.jl:64
in minfinite at /home/tim/.julia/v0.4/Images/src/algorithms.jl:164
in call at /home/tim/.julia/v0.4/Images/src/map.jl:161
in take at /home/tim/.julia/v0.4/Images/src/map.jl:347
in map! at /home/tim/.julia/v0.4/Images/src/map.jl:336
in map at /home/tim/.julia/v0.4/Images/src/map.jl:311
in eval at no file
```
See how much easier it is debugging is this way? I especially like the fact that I wouldn't have had to use the "add @show statements"/"restart"/"reload Images (10s)" so many times.