Optimize grouping to reduce duplicate outputs on flush().
Optimize grouping to reduce duplicate outputs on flush().

The previous implementation of #flush() for both PushGroup and PushArgAgg
emitted a new result set unconditionally. That is overly enthusiastic: if the
grouping operator has not received any new input since the last call to
copy of our previous result set.

On a microbenchmark (an aggregation operation with 2000 distinct groups), this
improves performance by ~40%.

bloom-lang/bud