smarty-prototypes / go-disruptor

A port of the LMAX Disruptor to the Go language.
Apache License 2.0
1.37k stars 212 forks source link

Why allocate new local var(lower,upper) inside loop instead of allocate outside that. #8

Closed lvhuat closed 5 years ago

lvhuat commented 5 years ago

Code locate at:https://github.com/smartystreets/go-disruptor/blob/master/reader.go#L39

lower,upper := 0,0 for { // use lower and upper; }