Skip to content

Commit

Permalink
Add skeletal set of things
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 5, 2015
1 parent 5a54e1b commit 8df0840
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# use glob syntax.
syntax: glob
*.class
*~
*.bak
*.off
*.old
.DS_Store
jmh.out

# building
target

# Eclipse
.classpath
.project
.settings

# IDEA
.idea
*.iml
*.ipr
*.iws
/target/
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# json-performance-benchmarks
Collection of jmh-based benchmarks that compare performance Java JSON libraries for reading, writing
# Overview

This project contains a set of performance micro-benchmarks, based on excellent
[JMH](http://openjdk.java.net/projects/code-tools/jmh/) package.
Benchmarks exercise JSON reading and/or writing performance of a few popular Java JSON libraries:

* [https://github.com/FasterXML/jackson](Jackson)
* [https://github.com/google/gson](GSON)

# Status

Somewhat experimental. But has been used with success in optimizing Jackson 2.4 release!
128 changes: 128 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.fasterxml</groupId>
<artifactId>oss-parent</artifactId>
<version>20</version>
</parent>

<artifactId>java-json-performance</artifactId>
<version>0.5.0-SNAPSHOT</version>
<name>Java JSON Performance Benchmarks</name>
<packaging>jar</packaging>

<description>A suite of JMH-based micro-benchmarks used for Java JSON library performance comparison
</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<version.jackson.annotations>2.6.0</version.jackson.annotations>
<version.jackson>2.6.0</version.jackson>
<version.gson>2.3.1</version.gson>

<version.jmh>1.9.3</version.jmh>
</properties>

<dependencies>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${version.jmh}</version>
</dependency>

<!-- As per [http://stackoverflow.com/questions/23891586/jmh-not-working-in-eclipse-as-maven-project-no-benchmarks-to-run]
we need another dep
-->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${version.jmh}</version>
<!-- the processor artifact is required only during compilation and
does not need to be transitive, hence provided scope
-->
<scope>provided</scope>
</dependency>

<!-- First, Jackson deps -->

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${version.jackson.annotations}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${version.jackson}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${version.jackson}</version>
</dependency>

<!-- may want to test Afterburner-enabled Jackson? -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-afterburner</artifactId>
<version>${version.jackson}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-objects</artifactId>
<version>${version.jackson}</version>
</dependency>

<!-- and GSON -->

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<optimize>true</optimize>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>microbenchmarks</finalName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.openjdk.jmh.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 8df0840

Please sign in to comment.