"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/StringBuilderEscapeBenchmark.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).

StringBuilderEscapeBenchmark.java  (apache-log4j-2.11.1-src):StringBuilderEscapeBenchmark.java  (apache-log4j-2.11.2-src)
skipping to change at line 71 skipping to change at line 71
@Benchmark @Benchmark
@BenchmarkMode(Mode.SampleTime) @BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS) @OutputTimeUnit(TimeUnit.NANOSECONDS)
public int escapeXmlLargeString(final ThreadState state) { public int escapeXmlLargeString(final ThreadState state) {
state.buffer.setLength(0); state.buffer.setLength(0);
state.buffer.append(EVERY_CHARACTER_MUST_BE_ESCAPED_XML); state.buffer.append(EVERY_CHARACTER_MUST_BE_ESCAPED_XML);
StringBuilders.escapeXml(state.buffer, 0); StringBuilders.escapeXml(state.buffer, 0);
return state.buffer.length(); return state.buffer.length();
} }
private static String repeat(String str, int times) { private static String repeat(final String str, final int times) {
StringBuilder sb = new StringBuilder(str.length() * times); final StringBuilder sb = new StringBuilder(str.length() * times);
for (int i = 0; i < times; i++) { for (int i = 0; i < times; i++) {
sb.append(str); sb.append(str);
} }
return sb.toString(); return sb.toString();
} }
} }
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added

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