Skip to content

Commit

Permalink
preserve inline line numbers during inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Oct 7, 2015
1 parent 8c11f0c commit a33cd07
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2248,8 +2248,7 @@ function inlineable(f::ANY, e::Expr, atype::ANY, sv::StaticVarInfo, enclosing_as
end

body = Expr(:block)
body.args = filter(x->!((isa(x,Expr) && is(x.head,:line)) || isa(x,LineNumberNode)),
ast.args[3].args::Array{Any,1})
body.args = ast.args[3].args::Array{Any,1}
cost::Int = 1000
if incompletematch
cost *= 4
Expand Down

1 comment on commit a33cd07

@andreasnoack
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vtjnash Before:

julia> @time for i = 1:10000
       Y = randn(100,10);
       cov(Y)
       end
  0.156312 seconds (200.00 k allocations: 171.661 MB, 13.23% gc time)

after

julia> @time for i = 1:10000
       Y = randn(100,10);
       cov(Y)
       end
  0.529782 seconds (10.71 M allocations: 334.778 MB, 8.80% gc time)

Hopefully, the @nanosoldier will soon have received enough training to detect such a change.

Please sign in to comment.