"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AbstractStringLayoutStringEncodingBenchmark.java" between
apache-log4j-2.11.1-src.tar.gz and apache-log4j-2.11.2-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).

AbstractStringLayoutStringEncodingBenchmark.java  (apache-log4j-2.11.1-src):AbstractStringLayoutStringEncodingBenchmark.java  (apache-log4j-2.11.2-src)
skipping to change at line 126 skipping to change at line 126
.setContextStack(ndc) // .setContextStack(ndc) //
.setThreadName(threadName) // .setThreadName(threadName) //
.setSource(location) // .setSource(location) //
.setTimeMillis(timestamp) // .setTimeMillis(timestamp) //
.build(); .build();
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void baseline() { public long baseline() {
consume(bytes); return consume(bytes);
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void usAsciiGetBytes() { public long usAsciiGetBytes() {
consume(usAsciiGetBytesLayout.toByteArray(logEvent)); return consume(usAsciiGetBytesLayout.toByteArray(logEvent));
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void usAsciiEncode() { public void usAsciiEncode() {
destination.reset(); destination.reset();
usAsciiEncodeLayout.encode(logEvent, destination); usAsciiEncodeLayout.encode(logEvent, destination);
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void iso8859_1GetBytes() { public long iso8859_1GetBytes() {
consume(iso8859_1GetBytesLayout.toByteArray(logEvent)); return consume(iso8859_1GetBytesLayout.toByteArray(logEvent));
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void iso8859_1Encode() { public void iso8859_1Encode() {
destination.reset(); destination.reset();
iso8859_1EncodeLayout.encode(logEvent, destination); iso8859_1EncodeLayout.encode(logEvent, destination);
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void utf8GetBytes() { public long utf8GetBytes() {
consume(utf8GetBytesLayout.toByteArray(logEvent)); return consume(utf8GetBytesLayout.toByteArray(logEvent));
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void utf8Encode() { public void utf8Encode() {
destination.reset(); destination.reset();
utf8EncodeLayout.encode(logEvent, destination); utf8EncodeLayout.encode(logEvent, destination);
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void utf16GetBytes() { public long utf16GetBytes() {
consume(utf16GetBytesLayout.toByteArray(logEvent)); return consume(utf16GetBytesLayout.toByteArray(logEvent));
} }
@BenchmarkMode(Mode.Throughput) @BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS) @OutputTimeUnit(TimeUnit.MILLISECONDS)
@Benchmark @Benchmark
public void utf16Encode() { public void utf16Encode() {
destination.reset(); destination.reset();
utf16EncodeLayout.encode(logEvent, destination); utf16EncodeLayout.encode(logEvent, destination);
} }
 End of changes. 5 change blocks. 
10 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)