Skip to content

Commit

Permalink
fix #5011
Browse files Browse the repository at this point in the history
It's pretty bad that you could get a 10x slowdown just from adding up a few
things, hence it was time for an undisciplined hack.
  • Loading branch information
JeffBezanson committed Apr 19, 2015
1 parent adece88 commit 86ffe49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2297,7 +2297,9 @@ function inlineable(f::ANY, e::Expr, atype::ANY, sv::StaticVarInfo, enclosing_as
if is(f, next) || is(f, done) || is(f, unsafe_convert) || is(f, cconvert)
cost /= 4
end
if !inline_worthy(body, cost)
inline_op = (f===(+) || f===(*) || f===min || f===max) && (3 <= length(argexprs) <= 9) &&
meth[3].sig == Tuple{Any,Any,Any,Vararg{Any}}
if !inline_op && !inline_worthy(body, cost)

This comment has been minimized.

Copy link
@vtjnash

vtjnash Apr 19, 2015

Member

the intention here is that you should only ever be using cost modifications, rather than ever trying to bypass inline_worthy entirely. for example, this introduces a bug where @noinline will now be ignored for these methods.

if incompletematch
# inline a typeassert-based call-site, rather than a
# full generic lookup, using the inliner to handle
Expand Down

1 comment on commit 86ffe49

@carnaval
Copy link
Contributor

Choose a reason for hiding this comment

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

"The inlining heuristics started out simple"

Please sign in to comment.