You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/05/05 17:25:39 UTC

[1/4] logging-log4j2 git commit: LOG4J2-1179 refactor IPerfTestRunner implementation to avoid Logger lookup in #log() method

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 01c77f691 -> c95e46b83


LOG4J2-1179 refactor IPerfTestRunner implementation to avoid Logger lookup in #log() method


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

Branch: refs/heads/master
Commit: 69a1ac2f565dbd39c2f348691c5ae97b8659301a
Parents: 6e72fe6
Author: rpopma <rp...@apache.org>
Authored: Thu May 5 10:05:09 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Thu May 5 10:05:09 2016 +0900

----------------------------------------------------------------------
 .../apache/logging/log4j/core/async/perftest/RunLog4j1.java | 9 +++++----
 .../apache/logging/log4j/core/async/perftest/RunLog4j2.java | 8 ++++----
 .../logging/log4j/core/async/perftest/RunLogback.java       | 8 ++++----
 3 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/69a1ac2f/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j1.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j1.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j1.java
index 3903528..6db549e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j1.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j1.java
@@ -23,10 +23,12 @@ import com.lmax.disruptor.collections.Histogram;
 
 public class RunLog4j1 implements IPerfTestRunner {
 
+    final Logger LOGGER = LogManager.getLogger(getClass());
+
     @Override
     public void runThroughputTest(final int lines, final Histogram histogram) {
         final long s1 = System.nanoTime();
-        final Logger logger = LogManager.getLogger(getClass());
+        final Logger logger = LOGGER;
         for (int j = 0; j < lines; j++) {
             logger.info(THROUGHPUT_MSG);
         }
@@ -38,7 +40,7 @@ public class RunLog4j1 implements IPerfTestRunner {
     @Override
     public void runLatencyTest(final int samples, final Histogram histogram,
             final long nanoTimeCost, final int threadCount) {
-        final Logger logger = LogManager.getLogger(getClass());
+        final Logger logger = LOGGER;
         for (int i = 0; i < samples; i++) {
             final long s1 = System.nanoTime();
             logger.info(LATENCY_MSG);
@@ -63,7 +65,6 @@ public class RunLog4j1 implements IPerfTestRunner {
 
     @Override
     public void log(final String finalMessage) {
-        final Logger logger = LogManager.getLogger(getClass());
-        logger.info(finalMessage);
+        LOGGER.info(finalMessage);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/69a1ac2f/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j2.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j2.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j2.java
index bcfaa92..df2a15d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j2.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLog4j2.java
@@ -22,11 +22,12 @@ import org.apache.logging.log4j.core.CoreLoggerContexts;
 import com.lmax.disruptor.collections.Histogram;
 
 public class RunLog4j2 implements IPerfTestRunner {
+    final Logger LOGGER = LogManager.getLogger(getClass());
 
     @Override
     public void runThroughputTest(final int lines, final Histogram histogram) {
         final long s1 = System.nanoTime();
-        final Logger logger = LogManager.getLogger(getClass());
+        final Logger logger = LOGGER;
         for (int j = 0; j < lines; j++) {
             logger.info(THROUGHPUT_MSG);
         }
@@ -39,7 +40,7 @@ public class RunLog4j2 implements IPerfTestRunner {
     @Override
     public void runLatencyTest(final int samples, final Histogram histogram,
             final long nanoTimeCost, final int threadCount) {
-        final Logger logger = LogManager.getLogger(getClass());
+        final Logger logger = LOGGER;
         for (int i = 0; i < samples; i++) {
             final long s1 = System.nanoTime();
             logger.info(LATENCY_MSG);
@@ -66,7 +67,6 @@ public class RunLog4j2 implements IPerfTestRunner {
 
     @Override
     public void log(final String finalMessage) {
-        final Logger logger = LogManager.getLogger(getClass());
-        logger.info(finalMessage);
+        LOGGER.info(finalMessage);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/69a1ac2f/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLogback.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLogback.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLogback.java
index c6f0c29..aaf22c6 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLogback.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/RunLogback.java
@@ -24,11 +24,12 @@ import ch.qos.logback.core.spi.LifeCycle;
 import com.lmax.disruptor.collections.Histogram;
 
 public class RunLogback implements IPerfTestRunner {
+    final Logger LOGGER = (Logger) LoggerFactory.getLogger(getClass());
 
     @Override
     public void runThroughputTest(final int lines, final Histogram histogram) {
         final long s1 = System.nanoTime();
-        final Logger logger = (Logger) LoggerFactory.getLogger(getClass());
+        final Logger logger = LOGGER;
         for (int j = 0; j < lines; j++) {
             logger.info(THROUGHPUT_MSG);
         }
@@ -40,7 +41,7 @@ public class RunLogback implements IPerfTestRunner {
     @Override
     public void runLatencyTest(final int samples, final Histogram histogram,
             final long nanoTimeCost, final int threadCount) {
-        final Logger logger = (Logger) LoggerFactory.getLogger(getClass());
+        final Logger logger = LOGGER;
         for (int i = 0; i < samples; i++) {
             final long s1 = System.nanoTime();
             logger.info(LATENCY_MSG);
@@ -65,7 +66,6 @@ public class RunLogback implements IPerfTestRunner {
 
     @Override
     public void log(final String msg) {
-        final Logger logger = (Logger) LoggerFactory.getLogger(getClass());
-        logger.info(msg);
+        LOGGER.info(msg);
     }
 }


[3/4] logging-log4j2 git commit: LOG4J2-1179 modified and added benchmarks to compare parameterized message performance

Posted by rp...@apache.org.
LOG4J2-1179 modified and added benchmarks to compare parameterized message performance


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

Branch: refs/heads/master
Commit: 990d071d838830fd69d1c31ae9edc23ee078d88b
Parents: 3f37f18
Author: rpopma <rp...@apache.org>
Authored: Fri May 6 02:25:47 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Fri May 6 02:25:47 2016 +0900

----------------------------------------------------------------------
 .../core/appender/CountingNoOpAppender.java     |  56 +++++++
 .../async/perftest/CountingNoOpAppender.java    |  52 ------
 .../perf/jmh/AsyncAppenderLog4j1Benchmark.java  | 113 +++++++++----
 .../perf/jmh/AsyncAppenderLog4j2Benchmark.java  | 120 ++++++++++----
 .../perf/jmh/AsyncAppenderLogbackBenchmark.java | 118 +++++++++----
 .../log4j/perf/jmh/AsyncLoggersBenchmark.java   | 118 +++++++++----
 .../perf/jmh/MemoryHandlerJULBenchmark.java     | 164 +++++++++++++++++++
 .../log4j/perf/util/BenchmarkMessageParams.java |  42 +++++
 .../logging/log4j/perf/util/NoOpJULHandler.java |  41 +++++
 .../log4j/perf/util/NoOpLog4jAppender.java      |  44 +++++
 .../log4j/perf/util/NoOpLogbackAppender.java    |  33 ++++
 .../perf-log4j12-async-noOpAppender.xml         |  30 ++++
 .../perf-logback-async-noOpAppender.xml         |  31 ++++
 .../perf5AsyncApndNoLoc-noOpAppender.xml        |  31 ++++
 14 files changed, 810 insertions(+), 183 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java
new file mode 100644
index 0000000..a8e48dc
--- /dev/null
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.core.appender;
+
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.logging.log4j.core.Layout;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
+import org.apache.logging.log4j.core.config.plugins.PluginFactory;
+
+/**
+ * No-Operation Appender that counts events.
+ */
+@Plugin(name = "CountingNoOp", category = "Core", elementType = "appender", printObject = true)
+public class CountingNoOpAppender extends AbstractAppender  {
+
+    private AtomicLong total = new AtomicLong();
+
+    public CountingNoOpAppender(String name, Layout<?> layout) {
+        super(name, null, layout);
+    }
+
+    public long getCount() {
+        return total.get();
+    }
+
+    @Override
+    public void append(LogEvent event) {
+        total.incrementAndGet();
+    }
+
+    /**
+     * Creates a CountingNoOp Appender.
+     */
+    @PluginFactory
+    public static CountingNoOpAppender createAppender(@PluginAttribute("name") final String name) {
+        return new CountingNoOpAppender(Objects.requireNonNull(name), null);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/CountingNoOpAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/CountingNoOpAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/CountingNoOpAppender.java
deleted file mode 100644
index bb92bcf..0000000
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/perftest/CountingNoOpAppender.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.async.perftest;
-
-import java.util.Objects;
-
-import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.appender.AbstractAppender;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-
-/**
- * No-Operation Appender that counts events.
- */
-@Plugin(name = "CountingNoOp", category = "Core", elementType = "appender", printObject = true)
-public class CountingNoOpAppender extends AbstractAppender  {
-
-    public static long total;
-
-    public CountingNoOpAppender(String name, Layout<?> layout) {
-        super(name, null, layout);
-    }
-
-    @Override
-    public void append(LogEvent event) {
-        total++;
-    }
-
-    /**
-     * Creates a CountingNoOp Appender.
-     */
-    @PluginFactory
-    public static CountingNoOpAppender createAppender(@PluginAttribute("name") final String name) {
-        return new CountingNoOpAppender(Objects.requireNonNull(name), null);
-    }
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1Benchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1Benchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1Benchmark.java
index db35fbb..8a94382 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1Benchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j1Benchmark.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Level;
@@ -31,6 +32,7 @@ import org.openjdk.jmh.annotations.Scope;
 import org.openjdk.jmh.annotations.Setup;
 import org.openjdk.jmh.annotations.State;
 import org.openjdk.jmh.annotations.TearDown;
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
 
 /**
  * Tests Log4j-1.2 Async Appender performance.
@@ -46,56 +48,103 @@ import org.openjdk.jmh.annotations.TearDown;
 // Usage help:
 // java -jar log4j-perf/target/benchmarks.jar -help
 //
+@State(Scope.Benchmark)
 public class AsyncAppenderLog4j1Benchmark {
+    Logger logger;
 
-    final static char[] CHARS = new char[500];
-    static {
-        Arrays.fill(CHARS, 'a');
+    @Setup(Level.Trial)
+    public void up() {
+        System.setProperty("log4j.configuration", "perf-log4j12-async-noOpAppender.xml");
+        logger = LogManager.getLogger(getClass());
     }
-    final static String TEST = new String(CHARS);
-
-    @State(Scope.Benchmark)
-    public static class NormalState {
-        Logger logger;
-
-        @Setup(Level.Trial)
-        public void up() {
-            System.setProperty("log4j.configuration", "perf-log4j12-async.xml");
-            logger = LogManager.getLogger(getClass());
-        }
-
-        @TearDown(Level.Trial)
-        public void down() {
-            LogManager.shutdown();
-            new File("perftest.log").delete();
-        }
+
+    @TearDown(Level.Trial)
+    public void down() {
+        LogManager.shutdown();
+        new File("perftest.log").delete();
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.info(BenchmarkMessageParams.TEST);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public boolean throughputBaseline(final NormalState e) {
-        return e.logger.isInfoEnabled();
+    public void throughput1Param() {
+        logger.info("p1=" + one);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public void throughput(final NormalState e) {
-        e.logger.info(TEST);
+    public void throughput2Params() {
+        logger.info("p1=" + one + ", p2=" + two);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public boolean latencyBaseline(final NormalState e) {
-        return e.logger.isInfoEnabled();
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput3Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput4Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput5Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four + ", p5=" + five);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput6Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four + ", p5=" + five + ", p6=" + six);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latency(final NormalState e) {
-        e.logger.info(TEST);
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput7Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four + ", p5=" + five + ", p6=" + six + ", p7=" + seven);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput8Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four + ", p5=" + five + ", p6=" + six + ", p7=" + seven + ", p8=" + eight);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput9Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four + ", p5=" + five + ", p6=" + six + ", p7=" + seven + ", p8=" + eight + ", p9=" + nine);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput10Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four + ", p5=" + five + ", p6=" + six + ", p7=" + seven + ", p8=" + eight + ", p9=" + nine + ", p10=" + ten);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput11Params() {
+        logger.info("p1=" + one + ", p2=" + two + ", p3=" + three + ", p4=" + four + ", p5=" + five + ", p6=" + six + ", p7=" + seven + ", p8=" + eight + ", p9=" + nine + ", p10=" + ten + ", p11=" + eleven);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2Benchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2Benchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2Benchmark.java
index 523b029..77fab56 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2Benchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLog4j2Benchmark.java
@@ -17,12 +17,12 @@
 package org.apache.logging.log4j.perf.jmh;
 
 import java.io.File;
-import java.util.Arrays;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.LifeCycle;
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Level;
@@ -33,6 +33,8 @@ import org.openjdk.jmh.annotations.Setup;
 import org.openjdk.jmh.annotations.State;
 import org.openjdk.jmh.annotations.TearDown;
 
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
+
 /**
  * Tests Log4j2 Async Appender performance.
  */
@@ -47,55 +49,107 @@ import org.openjdk.jmh.annotations.TearDown;
 // Usage help:
 // java -jar log4j-perf/target/benchmarks.jar -help
 //
+@State(Scope.Benchmark)
 public class AsyncAppenderLog4j2Benchmark {
-    final static char[] CHARS = new char[500];
-    static {
-        Arrays.fill(CHARS, 'a');
+    Logger logger;
+
+    @Setup(Level.Trial)
+    public void up() {
+        System.setProperty("log4j.configurationFile", "perf5AsyncApndNoLoc-noOpAppender.xml");
+        logger = LogManager.getLogger(getClass());
+    }
+
+    @TearDown(Level.Trial)
+    public void down() {
+        ((LifeCycle) LogManager.getContext(false)).stop();
+        new File("perftest.log").delete();
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.info(BenchmarkMessageParams.TEST);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput1Param() {
+        logger.info("p1={}", one);
     }
-    final static String TEST = new String(CHARS);
-
-    @State(Scope.Benchmark)
-    public static class NormalState {
-        Logger logger;
-
-        @Setup(Level.Trial)
-        public void up() {
-            System.setProperty("log4j.configurationFile", "perf5AsyncApndNoLoc.xml");
-            logger = LogManager.getLogger(getClass());
-        }
-
-        @TearDown(Level.Trial)
-        public void down() {
-            ((LifeCycle) LogManager.getContext(false)).stop();
-            new File("perftest.log").delete();
-        }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput2Params() {
+        logger.info("p1={}, p2={}", one, two);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public boolean throughputBaseline(final NormalState e) {
-        return e.logger.isInfoEnabled();
+    public void throughput3Params() {
+        logger.info("p1={}, p2={}, p3={}", one, two, three);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public void throughput(final NormalState e) {
-        e.logger.info(TEST);
+    public void throughput4Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}", one, two, three, four);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public boolean latencyBaseline(final NormalState e) {
-        return e.logger.isInfoEnabled();
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput5Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}", one, two, three, four, five);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latency(final NormalState e) {
-        e.logger.info(TEST);
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput6Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}", one, two, three, four, five, six);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput7Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}", one, two, three, four, five, six, seven);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput8Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}", one, two, three, four, five, six, seven,
+                eight);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput9Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}", one, two, three, four, five, six,
+                seven, eight, nine);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput10Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}", one, two, three, four,
+                five, six, seven, eight, nine, ten);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput11Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}, p11={}", one, two, three,
+                four, five, six, seven, eight, nine, ten, eleven);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackBenchmark.java
index 5c8c5cc..45f0e88 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncAppenderLogbackBenchmark.java
@@ -20,6 +20,7 @@ import java.io.File;
 import java.util.Arrays;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Level;
@@ -31,6 +32,7 @@ import org.openjdk.jmh.annotations.State;
 import org.openjdk.jmh.annotations.TearDown;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
 
 import ch.qos.logback.core.spi.LifeCycle;
 
@@ -48,56 +50,108 @@ import ch.qos.logback.core.spi.LifeCycle;
 // Usage help:
 // java -jar log4j-perf/target/benchmarks.jar -help
 //
+@State(Scope.Benchmark)
 public class AsyncAppenderLogbackBenchmark {
 
-    final static char[] CHARS = new char[500];
-    static {
-        Arrays.fill(CHARS, 'a');
+    private Logger logger;
+
+    @Setup(Level.Trial)
+    public void up() {
+        System.setProperty("logback.configurationFile", "perf-logback-async-noOpAppender.xml");
+        logger = LoggerFactory.getLogger(getClass());
+    }
+
+    @TearDown(Level.Trial)
+    public void down() {
+        ((LifeCycle) LoggerFactory.getILoggerFactory()).stop();
+        new File("perftest.log").delete();
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.info(BenchmarkMessageParams.TEST);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput1Param() {
+        logger.info("p1={}", one);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput2Params() {
+        logger.info("p1={}, p2={}", one, two);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput3Params() {
+        logger.info("p1={}, p2={}, p3={}", one, two, three);
     }
-    final static String TEST = new String(CHARS);
-
-    @State(Scope.Benchmark)
-    public static class NormalState {
-        Logger logger;
-
-        @Setup(Level.Trial)
-        public void up() {
-            System.setProperty("logback.configurationFile", "perf-logback-async.xml");
-            logger = LoggerFactory.getLogger(getClass());
-        }
-
-        @TearDown(Level.Trial)
-        public void down() {
-            ((LifeCycle) LoggerFactory.getILoggerFactory()).stop();
-            new File("perftest.log").delete();
-        }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput4Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}", one, two, three, four);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput5Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}", one, two, three, four, five);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public boolean throughputBaseline(final NormalState e) {
-        return e.logger.isInfoEnabled();
+    public void throughput6Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}", one, two, three, four, five, six);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public void throughput(final NormalState e) {
-        e.logger.info(TEST);
+    public void throughput7Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}", one, two, three, four, five, six, seven);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public boolean latencyBaseline(final NormalState e) {
-        return e.logger.isInfoEnabled();
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput8Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}", one, two, three, four, five, six, seven,
+                eight);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latency(final NormalState e) {
-        e.logger.info(TEST);
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput9Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}", one, two, three, four, five, six,
+                seven, eight, nine);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput10Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}", one, two, three, four,
+                five, six, seven, eight, nine, ten);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput11Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}, p11={}", one, two, three,
+                four, five, six, seven, eight, nine, ten, eleven);
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersBenchmark.java
index c1714e1..6a160f9 100644
--- a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersBenchmark.java
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/AsyncLoggersBenchmark.java
@@ -18,12 +18,12 @@
 package org.apache.logging.log4j.perf.jmh;
 
 import java.io.File;
-import java.util.Arrays;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.LifeCycle;
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.BenchmarkMode;
 import org.openjdk.jmh.annotations.Level;
@@ -34,6 +34,8 @@ import org.openjdk.jmh.annotations.Setup;
 import org.openjdk.jmh.annotations.State;
 import org.openjdk.jmh.annotations.TearDown;
 
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
+
 /**
  * Tests Log4j2 Async Loggers performance.
  */
@@ -50,11 +52,6 @@ import org.openjdk.jmh.annotations.TearDown;
 //
 @State(Scope.Thread)
 public class AsyncLoggersBenchmark {
-    final static char[] CHARS = new char[16];
-    static {
-        Arrays.fill(CHARS, 'a');
-    }
-    final static String TEST = new String(CHARS);
 
     Logger logger;
 
@@ -81,69 +78,122 @@ public class AsyncLoggersBenchmark {
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
     public void throughputSimple() {
-        logger.info(TEST);
+        logger.info(BenchmarkMessageParams.TEST);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput1Param() {
+        logger.info("p1={}", one);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput2Params() {
+        logger.info("p1={}, p2={}", one, two);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
     public void throughput3Params() {
-        logger.info("p1={}, p2={}, p3={}", "1", "2", "3");
+        logger.info("p1={}, p2={}, p3={}", one, two, three);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public void throughput5Params() {
-        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}", "1", "2", "3", "4", "5");
+    public void throughput4Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}", one, two, three, four);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public void throughput7Params() {
-        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}", "1", "2", "3", "4", "5", "6", "7");
+    public void throughput5Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}", one, two, three, four, five);
     }
 
     @Benchmark
     @BenchmarkMode(Mode.Throughput)
     @OutputTimeUnit(TimeUnit.SECONDS)
-    public void throughput9Params() {
-        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}", "1", "2", "3", "4", "5", "6", "7", "8", "9");
+    public void throughput6Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}", one, two, three, four, five, six);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latencySimple() {
-        logger.info(TEST);
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput7Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}", one, two, three, four, five, six, seven);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latency3Params() {
-        logger.info("p1={}, p2={}, p3={}", "1", "2", "3");
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput8Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}", one, two, three, four, five, six, seven,
+                eight);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latency5Params() {
-        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}", "1", "2", "3", "4", "5");
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput9Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}", one, two, three, four, five, six,
+                seven, eight, nine);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latency7Params() {
-        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}", "1", "2", "3", "4", "5", "6", "7");
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput10Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}", one, two, three, four,
+                five, six, seven, eight, nine, ten);
     }
 
     @Benchmark
-    @BenchmarkMode(Mode.SampleTime)
-    @OutputTimeUnit(TimeUnit.NANOSECONDS)
-    public void latency9Params() {
-        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}", "1", "2", "3", "4", "5", "6", "7", "8", "9");
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput11Params() {
+        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}, p11={}", one, two, three,
+                four, five, six, seven, eight, nine, ten, eleven);
     }
+
+//    @Benchmark
+//    @BenchmarkMode(Mode.SampleTime)
+//    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+//    public void latencySimple() {
+//        logger.info(TEST);
+//    }
+//
+//    @Benchmark
+//    @BenchmarkMode(Mode.SampleTime)
+//    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+//    public void latency3Params() {
+//        logger.info("p1={}, p2={}, p3={}", "1", "2", "3");
+//    }
+//
+//    @Benchmark
+//    @BenchmarkMode(Mode.SampleTime)
+//    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+//    public void latency5Params() {
+//        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}", "1", "2", "3", "4", "5");
+//    }
+//
+//    @Benchmark
+//    @BenchmarkMode(Mode.SampleTime)
+//    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+//    public void latency7Params() {
+//        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}", "1", "2", "3", "4", "5", "6", "7");
+//    }
+//
+//    @Benchmark
+//    @BenchmarkMode(Mode.SampleTime)
+//    @OutputTimeUnit(TimeUnit.NANOSECONDS)
+//    public void latency9Params() {
+//        logger.info("p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}", "1", "2", "3", "4", "5", "6", "7", "8", "9");
+//    }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
new file mode 100644
index 0000000..a5044ac
--- /dev/null
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/MemoryHandlerJULBenchmark.java
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.jmh;
+
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Logger;
+import java.util.logging.MemoryHandler;
+
+import org.apache.logging.log4j.perf.util.BenchmarkMessageParams;
+import org.apache.logging.log4j.perf.util.NoOpJULHandler;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Mode;
+import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+
+import static org.apache.logging.log4j.perf.util.BenchmarkMessageParams.*;
+
+/**
+ * Tests JUL (java.util.logging) Memory Handler performance.
+ */
+// ============================== HOW TO RUN THIS TEST: ====================================
+//
+// single thread:
+// java -jar log4j-perf/target/benchmarks.jar ".*MemoryHandlerJULBenchmark.*" -f 1 -wi 5 -i 5
+//
+// multiple threads (for example, 4 threads):
+// java -jar log4j-perf/target/benchmarks.jar ".*MemoryHandlerJULBenchmark.*" -f 1 -wi 5 -i 5 -t 4 -si true
+//
+// Usage help:
+// java -jar log4j-perf/target/benchmarks.jar -help
+//
+@State(Scope.Benchmark)
+public class MemoryHandlerJULBenchmark {
+
+    Logger logger;
+    MemoryHandler memoryHandler;
+
+    @Setup(Level.Trial)
+    public void up() {
+        memoryHandler = new MemoryHandler(new NoOpJULHandler(), 262144, java.util.logging.Level.SEVERE);
+        logger = java.util.logging.Logger.getLogger(getClass().getName());
+        logger.setUseParentHandlers(false);
+        logger.addHandler(memoryHandler);
+        logger.setLevel(java.util.logging.Level.ALL);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughputSimple() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName", BenchmarkMessageParams.TEST);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput1Param() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName", "p1={}", one);
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput2Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName", "p1={}, p2={}",
+                new Object[]{one, two});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput3Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName","p1={}, p2={}, p3={}",
+                new Object[]{one, two, three});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput4Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}", new Object[]{one, two, three, four,});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput5Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}, p5={}", new Object[]{one, two, three, four, five,});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput6Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}, p5={}, p6={}",
+                new Object[]{one, two, three, four, five, six,});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput7Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}",
+                new Object[]{one, two, three, four, five, six, seven,});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput8Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}",
+                new Object[]{one, two, three, four, five, six, seven, eight,});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput9Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}",
+                new Object[]{one, two, three, four, five, six, seven, eight, nine,});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput10Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}",
+                new Object[]{one, two, three, four, five, six, seven, eight, nine, ten});
+    }
+
+    @Benchmark
+    @BenchmarkMode(Mode.Throughput)
+    @OutputTimeUnit(TimeUnit.SECONDS)
+    public void throughput11Params() {
+        logger.logp(java.util.logging.Level.INFO, getClass().getName(), "methodName",
+                "p1={}, p2={}, p3={}, p4={}, p5={}, p6={}, p7={}, p8={}, p9={}, p10={}, p11={}",
+                new Object[]{one, two, three, four, five, six, seven, eight, nine, ten, eleven});
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/BenchmarkMessageParams.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/BenchmarkMessageParams.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/BenchmarkMessageParams.java
new file mode 100644
index 0000000..a769c25
--- /dev/null
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/BenchmarkMessageParams.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.util;
+
+import java.util.Arrays;
+
+/**
+ * Created by remko on 5/5/2016.
+ */
+public class BenchmarkMessageParams {
+    final static char[] CHARS = new char[16];
+    static {
+        Arrays.fill(CHARS, 'a');
+    }
+    public final static String TEST = new String(CHARS);
+
+    public static volatile String one = "1";
+    public static volatile String two = "2";
+    public static volatile String three = "3";
+    public static volatile String four = "4";
+    public static volatile String five = "5";
+    public static volatile String six = "6";
+    public static volatile String seven = "7";
+    public static volatile String eight = "8";
+    public static volatile String nine = "9";
+    public static volatile String ten = "10";
+    public static volatile String eleven = "11";
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpJULHandler.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpJULHandler.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpJULHandler.java
new file mode 100644
index 0000000..1bc7890
--- /dev/null
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpJULHandler.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.util;
+
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Handler;
+import java.util.logging.LogRecord;
+
+/**
+ * JUL (java.util.logging) no-op handler..
+ */
+public class NoOpJULHandler extends Handler {
+    public AtomicLong count = new AtomicLong();
+
+    @Override
+    public void publish(final LogRecord record) {
+        count.incrementAndGet();
+    }
+
+    @Override
+    public void flush() {
+    }
+
+    @Override
+    public void close() throws SecurityException {
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLog4jAppender.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLog4jAppender.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLog4jAppender.java
new file mode 100644
index 0000000..a72d96a
--- /dev/null
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLog4jAppender.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.util;
+
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.log4j.AppenderSkeleton;
+import org.apache.log4j.spi.LoggingEvent;
+
+/**
+ * Log4j 1.2 no-op appender.
+ */
+public class NoOpLog4jAppender extends AppenderSkeleton {
+    public AtomicLong count = new AtomicLong();
+
+    @Override
+    protected void append(final LoggingEvent loggingEvent) {
+        count.incrementAndGet();
+    }
+
+    @Override
+    public void close() {
+
+    }
+
+    @Override
+    public boolean requiresLayout() {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLogbackAppender.java
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLogbackAppender.java b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLogbackAppender.java
new file mode 100644
index 0000000..d2dbae3
--- /dev/null
+++ b/log4j-perf/src/main/java/org/apache/logging/log4j/perf/util/NoOpLogbackAppender.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.perf.util;
+
+import java.util.concurrent.atomic.AtomicLong;
+
+import ch.qos.logback.core.AppenderBase;
+
+/**
+ * Logback no-op appender.
+ */
+public class NoOpLogbackAppender extends AppenderBase {
+    public AtomicLong count = new AtomicLong();
+
+    @Override
+    protected void append(final Object o) {
+        count.incrementAndGet();
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/resources/perf-log4j12-async-noOpAppender.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/resources/perf-log4j12-async-noOpAppender.xml b/log4j-perf/src/main/resources/perf-log4j12-async-noOpAppender.xml
new file mode 100644
index 0000000..c1ca476
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf-log4j12-async-noOpAppender.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache license, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the license for the specific language governing permissions and
+  limitations under the license.
+  -->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+    <appender name="NoOp" class="org.apache.logging.log4j.perf.util.NoOpLog4jAppender">
+     </appender>
+     <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+         <param name="BufferSize" value="262144"/>
+         <appender-ref ref="NoOp"/>
+     </appender>
+  <root>
+    <priority value="debug" />
+    <appender-ref ref="ASYNC" />
+  </root>
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/resources/perf-logback-async-noOpAppender.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/resources/perf-logback-async-noOpAppender.xml b/log4j-perf/src/main/resources/perf-logback-async-noOpAppender.xml
new file mode 100644
index 0000000..522f689
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf-logback-async-noOpAppender.xml
@@ -0,0 +1,31 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache license, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the license for the specific language governing permissions and
+  limitations under the license.
+  -->
+<configuration>
+
+  <appender name="NoOp" class="org.apache.logging.log4j.perf.util.NoOpLogbackAppender">
+  </appender>
+  <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
+    <queueSize>262144</queueSize>
+    <discardingThreshold>0</discardingThreshold>
+    <includeCallerData>false</includeCallerData>
+    <appender-ref ref="NoOp" />
+  </appender>
+
+  <root level="debug">
+    <appender-ref ref="ASYNC" />
+  </root>
+</configuration>

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/990d071d/log4j-perf/src/main/resources/perf5AsyncApndNoLoc-noOpAppender.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/src/main/resources/perf5AsyncApndNoLoc-noOpAppender.xml b/log4j-perf/src/main/resources/perf5AsyncApndNoLoc-noOpAppender.xml
new file mode 100644
index 0000000..a183691
--- /dev/null
+++ b/log4j-perf/src/main/resources/perf5AsyncApndNoLoc-noOpAppender.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache license, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the license for the specific language governing permissions and
+  limitations under the license.
+  -->
+<Configuration status="OFF">
+  <Appenders>
+    <CountingNoOp name="NoOp">
+    </CountingNoOp>
+    <Async name="Async"  blocking="true" bufferSize="262144">
+      <appender-ref ref="NoOp"/>
+    </Async>
+  </Appenders>
+  <Loggers>
+    <Root level="info" includeLocation="false">
+      <appender-ref ref="Async"/>
+    </Root>
+  </Loggers>
+</Configuration>


[4/4] logging-log4j2 git commit: Merge remote-tracking branch 'origin/master'

Posted by rp...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/master
Commit: c95e46b8330f32fc5a5e4757a59c3587bdc8b4d7
Parents: 990d071 01c77f6
Author: rpopma <rp...@apache.org>
Authored: Fri May 6 02:26:00 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Fri May 6 02:26:00 2016 +0900

----------------------------------------------------------------------
 pom.xml                 | 4 ++--
 src/changes/changes.xml | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/4] logging-log4j2 git commit: LOG4J2-1179 text clarification

Posted by rp...@apache.org.
LOG4J2-1179 text clarification


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

Branch: refs/heads/master
Commit: 3f37f184fe131839323dbb927613337385bc181d
Parents: 69a1ac2
Author: rpopma <rp...@apache.org>
Authored: Thu May 5 10:06:05 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Thu May 5 10:06:05 2016 +0900

----------------------------------------------------------------------
 src/site/xdoc/performance.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3f37f184/src/site/xdoc/performance.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/performance.xml b/src/site/xdoc/performance.xml
index 756f8b0..805091d 100644
--- a/src/site/xdoc/performance.xml
+++ b/src/site/xdoc/performance.xml
@@ -125,7 +125,7 @@
         an application with more threads can log more. The other logging libraries suffer
         from lock contention and total throughput stays constant or drops when more threads are logging.
         This means that with the other logging libraries, each individual thread will be able to log less.</em></p>
-      <p>Bear in mind that this is <em>peak</em> throughput: Log4j 2 gives better throughput up to a point, but
+      <p>Bear in mind that this is <em>peak</em> throughput: Log4j 2's Async Loggers give better throughput up to a point, but
         once the queue is full, the appender thread needs to wait until a slot becomes available in the queue,
         and throughput will drop to the maximum sustained throughput of the underlying appenders at best.
       </p>