Clone
 

alex blewitt <alblue@apple.com> in Netty

Replace accumulation with blackhole.consume (#9275)

Motivation:

SpotJMHBugs reports that accumulating a value as a way of eliding dead code

elimination may be inadvisable, as discussed in

`JMHSample_34_SafeLooping::measureWrong_2`. Change the test so that it consumes

the response with `Blackhole::consume` instead.

Modifications:

- Replace addition of results with explicit `blackhole.consume()` call

Result:

Tests work as before, but with different benchmark numbers.

Replace accumulation with blackhole.consume (#9275)

Motivation:

SpotJMHBugs reports that accumulating a value as a way of eliding dead code

elimination may be inadvisable, as discussed in

`JMHSample_34_SafeLooping::measureWrong_2`. Change the test so that it consumes

the response with `Blackhole::consume` instead.

Modifications:

- Replace addition of results with explicit `blackhole.consume()` call

Result:

Tests work as before, but with different benchmark numbers.