Generate JSON by hand.
This improves performance further.
Before:
Benchmark Mode Cnt Score Error Units
FormatterBenchmark.massivelyStructuredLogRecord thrpt 10 137879.001 ± 30467.644 ops/s
FormatterBenchmark.simpleLogRecord thrpt 10 896085.217 ± 249890.421 ops/s
FormatterBenchmark.structuredLogRecord thrpt 10 553428.807 ± 194787.754 ops/s
After:
Benchmark Mode Cnt Score Error Units
FormatterBenchmark.massivelyStructuredLogRecord thrpt 10 220855.729 ± 56336.321 ops/s
FormatterBenchmark.simpleLogRecord thrpt 10 4456647.085 ± 1041546.047 ops/s
FormatterBenchmark.structuredLogRecord thrpt 10 1500896.509 ± 543358.587 ops/s
There is also a new benchmark:
FormatterBenchmark.nestedLogRecord thrpt 10 878620.441 ± 297024.983 ops/s
Change-Id: If3e323b133f8e3e3ff29431a92d1b1e500f9b8b2
diff --git a/core/pom.xml b/core/pom.xml
index 595cf38..5a97f43 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -33,10 +33,17 @@
<optional>true</optional>
</dependency>
<dependency>
+ <groupId>jakarta.json</groupId>
+ <artifactId>jakarta.json-api</artifactId>
+ <version>2.1.3</version>
+ </dependency>
+ <dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-constraint</artifactId>
<version>2.4.0</version>
</dependency>
+
+ <!-- Include Parsson for backwards-compatibility. -->
<dependency>
<groupId>org.eclipse.parsson</groupId>
<artifactId>parsson</artifactId>
@@ -57,16 +64,16 @@
</dependency>
<dependency>
- <groupId>org.openjdk.jmh</groupId>
- <artifactId>jmh-core</artifactId>
- <version>1.35</version>
- <scope>test</scope>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-core</artifactId>
+ <version>1.35</version>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.openjdk.jmh</groupId>
- <artifactId>jmh-generator-annprocess</artifactId>
- <version>1.35</version>
- <scope>test</scope>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-generator-annprocess</artifactId>
+ <version>1.35</version>
+ <scope>test</scope>
</dependency>
</dependencies>