From 39f99d968f8a2b403103de44d0f0e0a1a23338be Mon Sep 17 00:00:00 2001 From: Rishabh Date: Fri, 28 Oct 2022 00:26:36 +0530 Subject: [PATCH 1/4] Creating static instance for Configuration --- .../java/io/appform/hope/core/visitors/Evaluator.java | 11 ++++++----- ...ope.lang.JsonPointerPerfTest.testPerfBulkEval.json | 4 ++-- ...e.lang.JsonPointerPerfTest.testPerfSingleEval.json | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hope-core/src/main/java/io/appform/hope/core/visitors/Evaluator.java b/hope-core/src/main/java/io/appform/hope/core/visitors/Evaluator.java index bd2ea81..e8edc18 100644 --- a/hope-core/src/main/java/io/appform/hope/core/visitors/Evaluator.java +++ b/hope-core/src/main/java/io/appform/hope/core/visitors/Evaluator.java @@ -58,6 +58,11 @@ */ public class Evaluator { private static final ObjectMapper mapper = new ObjectMapper(); + private static final JacksonJsonNodeJsonProvider jsonProvider = new JacksonJsonNodeJsonProvider(); + private static final Configuration configuration = Configuration.builder() + .jsonProvider(jsonProvider) + .options(Option.SUPPRESS_EXCEPTIONS) + .build(); static { mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); @@ -74,11 +79,7 @@ public Evaluator() { public Evaluator(ErrorHandlingStrategy errorHandlingStrategy) { this.errorHandlingStrategy = errorHandlingStrategy; - parseContext = JsonPath.using(Configuration.builder() - .jsonProvider(new JacksonJsonNodeJsonProvider()) - .options(Option.SUPPRESS_EXCEPTIONS) - .build()); - + parseContext = JsonPath.using(configuration); } public boolean evaluate(Evaluatable evaluatable, JsonNode node) { diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json index 1c65e37..9106412 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json @@ -3,6 +3,6 @@ "mode" : "Throughput", "iterations" : 2, "threads" : 1, - "forks" : 3, - "mean_ops" : 50011.37945804789 + "forks" : 0, + "mean_ops" : 65212.596212207645 } \ No newline at end of file diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json index 00efc20..068c3ce 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json @@ -3,6 +3,6 @@ "mode" : "Throughput", "iterations" : 2, "threads" : 1, - "forks" : 3, - "mean_ops" : 19769.422430905553 + "forks" : 0, + "mean_ops" : 187212.2780395726 } \ No newline at end of file From c73aea95b29cc018059c105bbfa07048ed973777 Mon Sep 17 00:00:00 2001 From: r0goyal Date: Thu, 27 Oct 2022 19:08:26 +0000 Subject: [PATCH 2/4] Comitting benchmark results created by Github Actions Signed-off-by: github-actions[bot] --- .../io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json | 2 +- .../io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json | 2 +- ...ppform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json | 4 ++-- ...form.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json index 2db8e8e..385fa47 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json @@ -4,5 +4,5 @@ "iterations" : 2, "threads" : 1, "forks" : 3, - "mean_ops" : 43317.02138091504 + "mean_ops" : 40145.9255924394 } \ No newline at end of file diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json index d952a6a..b6c80ef 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json @@ -4,5 +4,5 @@ "iterations" : 2, "threads" : 1, "forks" : 3, - "mean_ops" : 6425.229135058947 + "mean_ops" : 6919.724193095465 } \ No newline at end of file diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json index 9106412..b77116d 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json @@ -3,6 +3,6 @@ "mode" : "Throughput", "iterations" : 2, "threads" : 1, - "forks" : 0, - "mean_ops" : 65212.596212207645 + "forks" : 3, + "mean_ops" : 41982.144467542115 } \ No newline at end of file diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json index 068c3ce..41c1572 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json @@ -3,6 +3,6 @@ "mode" : "Throughput", "iterations" : 2, "threads" : 1, - "forks" : 0, - "mean_ops" : 187212.2780395726 + "forks" : 3, + "mean_ops" : 21665.070729464976 } \ No newline at end of file From 83c399095c21ad077ef672f4d8e7784d3b384b02 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Fri, 28 Oct 2022 12:27:30 +0530 Subject: [PATCH 3/4] Dummy From fe7f8972f0b65e93a50502c36fffa4589d24876c Mon Sep 17 00:00:00 2001 From: r0goyal Date: Fri, 28 Oct 2022 07:06:38 +0000 Subject: [PATCH 4/4] Comitting benchmark results created by Github Actions Signed-off-by: github-actions[bot] --- .../io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json | 2 +- .../io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json | 2 +- ....appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json | 2 +- ...ppform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json index 385fa47..5cfec22 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testBulkEval.json @@ -4,5 +4,5 @@ "iterations" : 2, "threads" : 1, "forks" : 3, - "mean_ops" : 40145.9255924394 + "mean_ops" : 43874.92701258367 } \ No newline at end of file diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json index b6c80ef..101964a 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPathPerfTest.testSingleEval.json @@ -4,5 +4,5 @@ "iterations" : 2, "threads" : 1, "forks" : 3, - "mean_ops" : 6919.724193095465 + "mean_ops" : 6916.92171285389 } \ No newline at end of file diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json index b77116d..a2f3ddb 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfBulkEval.json @@ -4,5 +4,5 @@ "iterations" : 2, "threads" : 1, "forks" : 3, - "mean_ops" : 41982.144467542115 + "mean_ops" : 46677.25687553518 } \ No newline at end of file diff --git a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json index 41c1572..8f033b7 100644 --- a/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json +++ b/hope-lang/perf/results/io.appform.hope.lang.JsonPointerPerfTest.testPerfSingleEval.json @@ -4,5 +4,5 @@ "iterations" : 2, "threads" : 1, "forks" : 3, - "mean_ops" : 21665.070729464976 + "mean_ops" : 25263.759552420383 } \ No newline at end of file