diff --git a/README.md b/README.md index 2745f74..cb9b42b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ implementation is poorly represented due to issues with the code in this repo. ## Feature comparison -To run the comparison: `./gradlew runFunctionalTests` +Run the feature comparison locally with `./gradlew runFunctionalTests`, or view previous runs on [GitHub][functionalTestRuns]. Runs each implementation through the standard [JSON Schema Test Suite][JSON-Schema-Test-Suite]. The suite contains both positive and negative test cases, i.e. JSON that should both pass and fail validation, @@ -168,7 +168,7 @@ There are also a couple of notes to call out for different implementations aroun ## Performance comparison -To run the comparison: `./gradlew runBenchmarks` +Run the performance comparison locally with `./gradlew runBenchmarks`, or view previous runs on [GitHub][performanceBenchmarkRuns]. How fast is the implementation at validating JSON? To find out, two different performance suites were run using the [Java Microbenchmark Harness][jhm]: @@ -309,4 +309,6 @@ Note: The author of this repository is not affiliated with any of the implementa [8]: https://github.com/erosb/json-sKema [JSON-Schema-Test-Suite]: https://github.com/json-schema-org/JSON-Schema-Test-Suite [jhm]: https://github.com/openjdk/jmh -[confluent]: https://www.confluent.io/ \ No newline at end of file +[confluent]: https://www.confluent.io/ +[functionalTestRuns]: https://github.com/creek-service/json-schema-validation-comparison/actions/workflows/run-func-test.yml +[performanceBenchmarkRuns]: https://github.com/creek-service/json-schema-validation-comparison/actions/workflows/run-perf-test.yml \ No newline at end of file diff --git a/src/main/java/org/creekservice/kafka/test/perf/testsuite/JsonTestSuiteMain.java b/src/main/java/org/creekservice/kafka/test/perf/testsuite/JsonTestSuiteMain.java index 2e79daa..acd6ac6 100644 --- a/src/main/java/org/creekservice/kafka/test/perf/testsuite/JsonTestSuiteMain.java +++ b/src/main/java/org/creekservice/kafka/test/perf/testsuite/JsonTestSuiteMain.java @@ -93,11 +93,10 @@ public static void main(final String... args) { } private static void outputResults(final Map results) { - - System.out.println(new PerDraftSummary(results)); - - System.out.println(); - + System.out.println("# Overall comparison"); System.out.println(new Summary(results)); + System.out.println(); + System.out.println("# Specific Draft & Implementation results"); + System.out.println(new PerDraftSummary(results)); } } diff --git a/src/main/java/org/creekservice/kafka/test/perf/testsuite/output/PerDraftSummary.java b/src/main/java/org/creekservice/kafka/test/perf/testsuite/output/PerDraftSummary.java index 5637ac9..e66af9a 100644 --- a/src/main/java/org/creekservice/kafka/test/perf/testsuite/output/PerDraftSummary.java +++ b/src/main/java/org/creekservice/kafka/test/perf/testsuite/output/PerDraftSummary.java @@ -59,7 +59,7 @@ public PerDraftSummary(final Map results) @Override public String toString() { return results.entrySet().stream() - .map(e -> e.getKey() + lineSeparator() + e.getValue()) + .map(e -> "## " + e.getKey() + lineSeparator() + e.getValue()) .collect(Collectors.joining(lineSeparator())); } diff --git a/src/main/java/org/creekservice/kafka/test/perf/util/Table.java b/src/main/java/org/creekservice/kafka/test/perf/util/Table.java index c7c472e..5e5fbd5 100644 --- a/src/main/java/org/creekservice/kafka/test/perf/util/Table.java +++ b/src/main/java/org/creekservice/kafka/test/perf/util/Table.java @@ -22,15 +22,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Comparator; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.function.BiConsumer; -import java.util.function.BiFunction; import java.util.function.Consumer; -import java.util.function.Predicate; import java.util.stream.Collectors; public class Table { @@ -43,10 +40,6 @@ public Table(final List headers) { this.headers = List.copyOf(requireNonNull(headers, "headers")); } - public List headers() { - return List.copyOf(headers); - } - public Row addRow() { final Row row = new Row(headers); rows.add(row); @@ -122,15 +115,6 @@ private static int width(final Object value) { .orElse(0); } - public void removeIf(final Predicate p) { - rows.removeIf(p); - widths.clear(); - } - - public void sort(final Comparator c) { - rows.sort(c); - } - public void map(final Consumer c) { rows.forEach(c); widths.clear(); @@ -151,18 +135,6 @@ public void put(final String header, final Object value) { values.put(header, requireNonNull(value, "value")); } - public void compute( - final String header, final BiFunction updater) { - values.compute( - header, - (h, existing) -> { - if (existing == null) { - validateHeader(h); - } - return requireNonNull(updater.apply(h, existing), "updater returned null"); - }); - } - public Collection values() { return values.values(); }