Repository: logging-log4j2
Updated Branches:
  refs/heads/release-2.x fc5401d40 -> c88601659


LOG4J2-2478 Return the computed variables on each benchmark to avoid DCE


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/869925c6
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/869925c6
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/869925c6

Branch: refs/heads/release-2.x
Commit: 869925c609b5700fba15b8291ddcdfba748cd7c2
Parents: fc5401d
Author: DiegoEliasCosta <[email protected]>
Authored: Mon Oct 15 13:21:30 2018 +0200
Committer: Carter Kozak <[email protected]>
Committed: Tue Oct 16 19:43:47 2018 -0400

----------------------------------------------------------------------
 ...ractStringLayoutStringEncodingBenchmark.java | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/869925c6/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java
----------------------------------------------------------------------
diff --git 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java
 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java
index 21b3e6a..959f6b2 100644
--- 
a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java
+++ 
b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java
@@ -123,15 +123,15 @@ public class AbstractStringLayoutStringEncodingBenchmark {
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @Benchmark
-    public void baseline() {
-        consume(bytes);
+    public long baseline() {
+        return consume(bytes);
     }
 
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @Benchmark
-    public void usAsciiGetBytes() {
-        consume(usAsciiGetBytesLayout.toByteArray(logEvent));
+    public long usAsciiGetBytes() {
+        return consume(usAsciiGetBytesLayout.toByteArray(logEvent));
     }
 
     @BenchmarkMode(Mode.Throughput)
@@ -145,8 +145,8 @@ public class AbstractStringLayoutStringEncodingBenchmark {
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @Benchmark
-    public void iso8859_1GetBytes() {
-        consume(iso8859_1GetBytesLayout.toByteArray(logEvent));
+    public long iso8859_1GetBytes() {
+        return consume(iso8859_1GetBytesLayout.toByteArray(logEvent));
     }
 
     @BenchmarkMode(Mode.Throughput)
@@ -160,8 +160,8 @@ public class AbstractStringLayoutStringEncodingBenchmark {
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @Benchmark
-    public void utf8GetBytes() {
-        consume(utf8GetBytesLayout.toByteArray(logEvent));
+    public long utf8GetBytes() {
+        return consume(utf8GetBytesLayout.toByteArray(logEvent));
     }
 
     @BenchmarkMode(Mode.Throughput)
@@ -175,8 +175,8 @@ public class AbstractStringLayoutStringEncodingBenchmark {
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.MILLISECONDS)
     @Benchmark
-    public void utf16GetBytes() {
-        consume(utf16GetBytesLayout.toByteArray(logEvent));
+    public long utf16GetBytes() {
+        return consume(utf16GetBytesLayout.toByteArray(logEvent));
     }
 
     @BenchmarkMode(Mode.Throughput)

Reply via email to