Skip to content

Commit

Permalink
introduced tiny benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
franz1981 authored and vietj committed Nov 29, 2023
1 parent 829a64a commit 0bed7c8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@BenchmarkMode(AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class JsonEncodeBenchmark extends BenchmarkBase {

private JsonObject tiny;
private JsonObject small;
private JsonObject wide;
private JsonObject deep;
Expand All @@ -51,6 +51,7 @@ public class JsonEncodeBenchmark extends BenchmarkBase {
@Setup
public void setup() {
ClassLoader classLoader = getClass().getClassLoader();
tiny = new JsonObject(Map.of("message", "Hello, World!"));
small = loadJson(classLoader.getResource("small_bench.json"));
wide = loadJson(classLoader.getResource("wide_bench.json"));
deep = loadJson(classLoader.getResource("deep_bench.json"));
Expand Down Expand Up @@ -106,6 +107,11 @@ private String stringDatabind(JsonObject jsonObject) {
return databindCodec.toString(jsonObject);
}

@Benchmark
public Buffer tinyBufferJackson() {
return bufferJackson(tiny);
}

@Benchmark
public Buffer smallBufferJackson() {
return bufferJackson(small);
Expand Down

0 comments on commit 0bed7c8

Please sign in to comment.