Skip to content

Commit e66786e

Browse files
author
Raj Barik
committed
Update budget
1 parent e4f855d commit e66786e

File tree

1 file changed

+4
-3
lines changed
  • src/cmd/compile/internal/inline

1 file changed

+4
-3
lines changed

src/cmd/compile/internal/inline/inl.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ import (
4444

4545
// Inlining budget parameters, gathered in one place
4646
const (
47-
inlineMaxBudget = 80
48-
inlineExtraAppendCost = 0
47+
inlineMaxBudget = 80
48+
// Budget increased due to hotness.
49+
inlineHotCalleeMaxBudget = 100
50+
inlineExtraAppendCost = 0
4951
// default is to inline if there's at most one call. -l=4 overrides this by using 1 instead.
5052
inlineExtraCallCost = 57 // 57 was benchmarked to provided most benefit with no bad surprises; see https://github.com/golang/go/issues/19348#issuecomment-439370742
5153
inlineExtraPanicCost = 1 // do not penalize inlining panics.
@@ -844,7 +846,6 @@ func mkinlcall(n *ir.CallExpr, fn *ir.Func, maxCost int32, inlCalls *[]*ir.Inlin
844846

845847
// If the callsite is hot and it is under the inlineHotCalleeMaxBudget budget, then inline it, or else bail.
846848
if _, ok := listOfHotCallSites[pgo.CallSiteInfo{ir.Line(n), ir.CurFunc}]; ok {
847-
848849
if fn.Inl.Cost > inlineHotCalleeMaxBudget {
849850
return n
850851
}

0 commit comments

Comments
 (0)