You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2024/08/27 08:32:00 UTC

(camel-performance-tests) branch main updated (ed0174b -> c126f1e)

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git


    from ed0174b  Fix compilation errors with newer Camel versions
     new 29cc14d  Improve granularity for the CSimple tests
     new 3c9bb66  Improve granularity for the Simple operator tests
     new c126f1e  Improve granularity for the CSimple tests

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/itest/jmh/CSimpleOperatorTest.java       | 43 +++++++++++-----------
 .../apache/camel/itest/jmh/SimpleOperatorTest.java | 43 +++++++++++-----------
 .../itest/jmh/{ => csimple}/CSimpleScript1.java    |  2 +-
 .../itest/jmh/{ => csimple}/CSimpleScript2.java    |  2 +-
 .../itest/jmh/{ => csimple}/CSimpleScript3.java    |  2 +-
 .../services/org/apache/camel/csimple.properties   |  6 +--
 6 files changed, 50 insertions(+), 48 deletions(-)
 rename tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/{ => csimple}/CSimpleScript1.java (97%)
 rename tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/{ => csimple}/CSimpleScript2.java (97%)
 rename tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/{ => csimple}/CSimpleScript3.java (97%)


(camel-performance-tests) 02/03: Improve granularity for the Simple operator tests

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git

commit 3c9bb66a2b9f242b9561f291e17d27efcc460ec8
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Aug 26 11:14:27 2024 +0200

    Improve granularity for the Simple operator tests
---
 .../apache/camel/itest/jmh/SimpleOperatorTest.java | 43 +++++++++++-----------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SimpleOperatorTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SimpleOperatorTest.java
index e7444ae..9d232be 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SimpleOperatorTest.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SimpleOperatorTest.java
@@ -57,8 +57,8 @@ public class SimpleOperatorTest {
                 // Set the following options as needed
                 .mode(Mode.All)
                 .timeUnit(TimeUnit.MICROSECONDS)
-                .warmupTime(TimeValue.seconds(1))
-                .warmupIterations(2)
+                .warmupTime(TimeValue.seconds(3))
+                .warmupIterations(5)
                 .measurementTime(TimeValue.seconds(10))
                 .measurementIterations(2)
                 .threads(2)
@@ -77,9 +77,9 @@ public class SimpleOperatorTest {
     @State(Scope.Thread)
     public static class BenchmarkState {
         CamelContext camel;
-        String expression = "${header.gold} == 123";
-        String expression2 = "${header.gold} > 123";
-        String expression3 = "${header.gold} < 123";
+        final String expressionEquals = "${header.gold} == 123";
+        final String expressionGreaterThan = "${header.gold} > 123";
+        final String expressionSmallerThan = "${header.gold} < 123";
         Exchange exchange;
         Language simple;
 
@@ -101,7 +101,7 @@ public class SimpleOperatorTest {
         @TearDown(Level.Trial)
         public void close() {
             try {
-                LOG.info("" + camel.getTypeConverterRegistry().getStatistics());
+                LOG.info("{}", camel.getTypeConverterRegistry().getStatistics());
                 camel.stop();
             } catch (Exception e) {
                 // ignore
@@ -112,22 +112,23 @@ public class SimpleOperatorTest {
 
     @Benchmark
     @Measurement(batchSize = 1000)
-    public void simplePredicate(BenchmarkState state, Blackhole bh) {
-        boolean out = state.simple.createPredicate(state.expression).matches(state.exchange);
-        if (!out) {
-            throw new IllegalArgumentException("Evaluation failed");
-        }
+    public void simplePredicateEquals(BenchmarkState state, Blackhole bh) {
+        boolean out = state.simple.createPredicate(state.expressionEquals).matches(state.exchange);
+        bh.consume(out);
+    }
+
+    @Benchmark
+    @Measurement(batchSize = 1000)
+    public void simplePredicateGreaterThan(BenchmarkState state, Blackhole bh) {
+        boolean out = state.simple.createPredicate(state.expressionGreaterThan).matches(state.exchange);
+        bh.consume(out);
+    }
+
+    @Benchmark
+    @Measurement(batchSize = 1000)
+    public void simplePredicateSmallerThan(BenchmarkState state, Blackhole bh) {
+        boolean out = state.simple.createPredicate(state.expressionSmallerThan).matches(state.exchange);
         bh.consume(out);
-        boolean out2 = state.simple.createPredicate(state.expression2).matches(state.exchange);
-        if (out2) {
-            throw new IllegalArgumentException("Evaluation failed");
-        }
-        bh.consume(out2);
-        boolean out3 = state.simple.createPredicate(state.expression3).matches(state.exchange);
-        if (out3) {
-            throw new IllegalArgumentException("Evaluation failed");
-        }
-        bh.consume(out3);
     }
 
 }


(camel-performance-tests) 03/03: Improve granularity for the CSimple tests

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git

commit c126f1ec4d4b0513c4730142b4c7a767e22e95db
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Aug 27 10:25:36 2024 +0200

    Improve granularity for the CSimple tests
---
 .../src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java
index 8d91b54..4502860 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java
@@ -57,7 +57,7 @@ public class CSimpleOperatorTest {
                 // Set the following options as needed
                 .mode(Mode.All)
                 .timeUnit(TimeUnit.MICROSECONDS)
-                .warmupTime(TimeValue.seconds(1))
+                .warmupTime(TimeValue.seconds(3))
                 .warmupIterations(5)
                 .measurementTime(TimeValue.seconds(10))
                 .measurementIterations(2)


(camel-performance-tests) 01/03: Improve granularity for the CSimple tests

Posted by or...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-performance-tests.git

commit 29cc14d0998b924e0e67cdb576bd3889729f1204
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Aug 26 10:58:19 2024 +0200

    Improve granularity for the CSimple tests
---
 .../camel/itest/jmh/CSimpleOperatorTest.java       | 41 +++++++++++-----------
 .../itest/jmh/{ => csimple}/CSimpleScript1.java    |  2 +-
 .../itest/jmh/{ => csimple}/CSimpleScript2.java    |  2 +-
 .../itest/jmh/{ => csimple}/CSimpleScript3.java    |  2 +-
 .../services/org/apache/camel/csimple.properties   |  6 ++--
 5 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java
index 055f838..8d91b54 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleOperatorTest.java
@@ -58,7 +58,7 @@ public class CSimpleOperatorTest {
                 .mode(Mode.All)
                 .timeUnit(TimeUnit.MICROSECONDS)
                 .warmupTime(TimeValue.seconds(1))
-                .warmupIterations(2)
+                .warmupIterations(5)
                 .measurementTime(TimeValue.seconds(10))
                 .measurementIterations(2)
                 .threads(2)
@@ -77,9 +77,9 @@ public class CSimpleOperatorTest {
     @State(Scope.Thread)
     public static class BenchmarkState {
         CamelContext camel;
-        String expression = "${header.gold} == 123";
-        String expression2 = "${header.gold} > 123";
-        String expression3 = "${header.gold} < 123";
+        final String expressionEquals = "${header.gold} == 123";
+        final String expressionGreaterThan = "${header.gold} > 123";
+        final String expressionSmallerThan = "${header.gold} < 123";
         Exchange exchange;
         Language csimple;
 
@@ -101,7 +101,7 @@ public class CSimpleOperatorTest {
         @TearDown(Level.Trial)
         public void close() {
             try {
-                LOG.info("" + camel.getTypeConverterRegistry().getStatistics());
+                LOG.info("{}", camel.getTypeConverterRegistry().getStatistics());
                 camel.stop();
             } catch (Exception e) {
                 // ignore
@@ -112,22 +112,23 @@ public class CSimpleOperatorTest {
 
     @Benchmark
     @Measurement(batchSize = 1000)
-    public void csimplePredicate(BenchmarkState state, Blackhole bh) {
-        boolean out = state.csimple.createPredicate(state.expression).matches(state.exchange);
-        if (!out) {
-            throw new IllegalArgumentException("Evaluation failed");
-        }
+    public void cSimplePredicateEquals(BenchmarkState state, Blackhole bh) {
+        boolean out = state.csimple.createPredicate(state.expressionEquals).matches(state.exchange);
         bh.consume(out);
-        boolean out2 = state.csimple.createPredicate(state.expression2).matches(state.exchange);
-        if (out2) {
-            throw new IllegalArgumentException("Evaluation failed");
-        }
-        bh.consume(out2);
-        boolean out3 = state.csimple.createPredicate(state.expression3).matches(state.exchange);
-        if (out3) {
-            throw new IllegalArgumentException("Evaluation failed");
-        }
-        bh.consume(out3);
+
     }
 
+    @Benchmark
+    @Measurement(batchSize = 1000)
+    public void cSimplePredicateGreater(BenchmarkState state, Blackhole bh) {
+        boolean out = state.csimple.createPredicate(state.expressionGreaterThan).matches(state.exchange);
+        bh.consume(out);
+    }
+
+    @Benchmark
+    @Measurement(batchSize = 1000)
+    public void cSimplePredicateSmaller(BenchmarkState state, Blackhole bh) {
+        boolean out = state.csimple.createPredicate(state.expressionSmallerThan).matches(state.exchange);
+        bh.consume(out);
+    }
 }
diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript1.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript1.java
similarity index 97%
rename from tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript1.java
rename to tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript1.java
index a94d7d5..4ab5749 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript1.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript1.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.itest.jmh;
+package org.apache.camel.itest.jmh.csimple;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript2.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript2.java
similarity index 97%
rename from tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript2.java
rename to tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript2.java
index b5f8312..a20d38d 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript2.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript2.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.itest.jmh;
+package org.apache.camel.itest.jmh.csimple;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
diff --git a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript3.java b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript3.java
similarity index 97%
rename from tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript3.java
rename to tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript3.java
index 64c6ec5..cc2bc1d 100644
--- a/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/CSimpleScript3.java
+++ b/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/csimple/CSimpleScript3.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.itest.jmh;
+package org.apache.camel.itest.jmh.csimple;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
diff --git a/tests/camel-jmh/src/test/resources/META-INF/services/org/apache/camel/csimple.properties b/tests/camel-jmh/src/test/resources/META-INF/services/org/apache/camel/csimple.properties
index fc8d8ef..7bdf4f6 100644
--- a/tests/camel-jmh/src/test/resources/META-INF/services/org/apache/camel/csimple.properties
+++ b/tests/camel-jmh/src/test/resources/META-INF/services/org/apache/camel/csimple.properties
@@ -15,6 +15,6 @@
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
 
-org.apache.camel.itest.jmh.CSimpleScript1
-org.apache.camel.itest.jmh.CSimpleScript2
-org.apache.camel.itest.jmh.CSimpleScript3
+org.apache.camel.itest.jmh.csimple.CSimpleScript1
+org.apache.camel.itest.jmh.csimple.CSimpleScript2
+org.apache.camel.itest.jmh.csimple.CSimpleScript3