[ 
https://issues.apache.org/jira/browse/LOG4J2-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma resolved LOG4J2-654.
--------------------------------

    Resolution: Fixed

Added log4j-perf module. The POM makes the JMH annotation processor part of the 
build, so any microbenchmarks with JMH annotations will have code generated for 
them and all generated code plus all dependencies are rolled into the resulting 
microbenchmarks.jar.

In this commit (revisions 1597422, 1597423 and 1597424) I only added the module 
and a single test: Log4jLogEventBenchmark.

To run the tests, execute 
{code}
java -jar log4j-perf/target/microbenchmarks.jar
{code}

By default, each test is run 10 times (10 "forks"), and the number of both 
warmup iterations and test iterations is very large (20 each I think).

I usually specify some options to have only 1 fork and 5 warmup/test 
iterations. To get usage help on the options, execute
{code}
java -jar log4j-perf/target/microbenchmarks.jar -help
{code}


> Use JMH for Log4j2 performance tests
> ------------------------------------
>
>                 Key: LOG4J2-654
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-654
>             Project: Log4j 2
>          Issue Type: Improvement
>    Affects Versions: 2.0-rc2
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>             Fix For: 2.0-rc2
>
>
> I've been using JMH (http://openjdk.java.net/projects/code-tools/jmh/ ) for 
> performance tests recently and I'm very impressed. JMH is developed by the 
> Oracle java performance team and used internally by Oracle to performance 
> tune the JVM and java core libraries.
> I would like to use JMH to start building a suite of performance tests for 
> log4j2.
> I propose adding a log4j-perf module. This is where our performance test code 
> would live. JMH microbenchmarks are very simple java classes with 
> org.openjdk.jmh annotations. During the build, JMH generates code and that 
> generated code, together with all dependencies are zipped up in a large 
> uber-jar with the maven Shade plugin. You can then use java -jar 
> microbenchmarks.jar to run performance tests.
> JMH is released under the GPL v2 license (incompatible with the Apache 
> License v2) so we need to be careful not to include the generated 
> microbenchmarks.jar or any other GPL files in the log4j distribution.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to