Skip to content

Commit

Permalink
pipeline: reduce tick message in-use objects (#2226)
Browse files Browse the repository at this point in the history
  • Loading branch information
overvenus authored Jul 7, 2021
1 parent 3c0be0d commit 661e175
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/pipeline/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@ func BarrierMessage(barrierTs model.Ts) *Message {
}
}

// TickMessage is called frequently,
// to ease GC pressure we return a global variable.
var tickMsg *Message = &Message{
Tp: MessageTypeTick,
}

// TickMessage creates the message of Tick
// Note: the returned message is READ-ONLY.
func TickMessage() *Message {
return &Message{
Tp: MessageTypeTick,
}
return tickMsg
}

// CommandType is the type of Command
Expand Down

0 comments on commit 661e175

Please sign in to comment.