GitHub user DiegoEliasCosta opened a pull request:
https://github.com/apache/logging-log4j2/pull/219
LOG4J2-2478 Return the computed variables on each benchmark to avoid DCE
As mentioned in [JIRA](https://issues.apache.org/jira/browse/LOG4J2-2478),
this patch simply returns the computation on every benchmark that uses the
static _consume_ method. We do that to prevent dead-code elimination, which is
only partially addressed in the current implementation.
Another patch that could simplify the benchmark code, and get considerably
faster throughputs, would be to simply rely on _Blackhole.consume_ methods to
sink the computation. We then, would not need the _consume_ method we have in
the class.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DiegoEliasCosta/logging-log4j2
jmh-antipatterns-ignoredreturn
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/logging-log4j2/pull/219.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #219
----
commit 59a41bb5dbe2f5edba9c4b7eb68f309ad7f637ce
Author: DiegoEliasCosta <diegoelias1@...>
Date: 2018-10-15T11:21:30Z
LOG4J2-2478 Return the computed variables on each benchmark to avoid DCE
----
---