You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "orpiske (via GitHub)" <gi...@apache.org> on 2023/09/01 14:29:57 UTC

[GitHub] [camel] orpiske opened a new pull request, #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

orpiske opened a new pull request, #11279:
URL: https://github.com/apache/camel/pull/11279

   This should help offset the performance impacts of removing the cached QueueReference on d66469d6ac7243f0ae790c41a500965b885d3180
   
   **4.1 (this patch)**
   ```
   Benchmark                                         Mode  Cnt    Score    Error   Units
   SedaRoundTripTest.sendBlocking                   thrpt   10  925.275 ±  1.146  ops/ms
   SedaRoundTripTest.sendBlockingWithMultipleTypes  thrpt   10  229.778 ±  0.107  ops/ms
   SedaRoundTripTest.sendBlockingWithMultipleTypes   avgt   10    0.004 ±  0.001   ms/op
   SedaRoundTripTest.sendBlocking                      ss   10    0.163 ±  0.035   ms/op
   SedaRoundTripTest.sendBlockingWithMultipleTypes     ss   10    0.570 ±  0.047   ms/op
   ```
   
   **4.1 (without the patch)**
   ```
   Benchmark                                         Mode  Cnt    Score    Error   Units
   SedaRoundTripTest.sendBlocking                   thrpt   10  915.329 ±  0.320  ops/ms
   SedaRoundTripTest.sendBlockingWithMultipleTypes  thrpt   10  225.853 ±  0.459  ops/ms
   SedaRoundTripTest.sendBlockingWithMultipleTypes   avgt   10    0.005 ±  0.001   ms/op
   SedaRoundTripTest.sendBlocking                      ss   10    0.167 ±  0.025   ms/op
   SedaRoundTripTest.sendBlockingWithMultipleTypes     ss   10    0.626 ±  0.222   ms/op
   ```
   
   **4.0 (baseline)**
   ```
   Benchmark                                         Mode  Cnt    Score    Error   Units
   SedaRoundTripTest.sendBlocking                   thrpt   10  922.456 ±  0.462  ops/ms
   SedaRoundTripTest.sendBlockingWithMultipleTypes  thrpt   10  242.381 ±  0.107  ops/ms
   SedaRoundTripTest.sendBlockingWithMultipleTypes   avgt   10    0.004 ±  0.001   ms/op
   SedaRoundTripTest.sendBlocking                      ss   10    0.162 ±  0.022   ms/op
   SedaRoundTripTest.sendBlockingWithMultipleTypes     ss   10    0.573 ±  0.044   ms/op
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702889843

   Another question, Is there a real-life use case where we heavily create queues? otherwise, I don't really get the real need of improving it.
   
   Do you have profiler reports indicating that this part of the code as an hot spot?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702903414

   You mean that we need to compare `925 ops/ms` for 4.1 with `922 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlocking` and `229 ops/ms` for 4.1 with `242 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlockingWithMultipleTypes`, right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on a diff in pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #11279:
URL: https://github.com/apache/camel/pull/11279#discussion_r1313124942


##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaComponent.java:
##########
@@ -189,10 +186,27 @@ public synchronized QueueReference getOrCreateQueue(
         log.debug("Created queue {} with size {}", key, size);
 
         // create and add a new reference queue
-        ref = new QueueReference(queue, size, multipleConsumers);
+        QueueReference ref = new QueueReference(queue, size, multipleConsumers);
         ref.addReference(endpoint);
         getQueues().put(key, ref);

Review Comment:
   Maybe we should consider creating the queue and the queue reference in a computeIfAbsent to prevent concurrent creation for the same key



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702886205

   Marking it as a draft as I want to go through @essobedo's comments next week. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702877602

   Maybe I misunderstood your results, but I don't see a real significant improvement, could you please clarify a bit your results?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske closed pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske closed pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize
URL: https://github.com/apache/camel/pull/11279


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702914992

   Obs.: please, do feel free to review. I'll go through your review comments next week. For now just answering the non-review questions as my brain is basically a jelly after this week. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702942963

   > > You mean that we need to compare `925 ops/ms` for 4.1 with `922 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlocking` and `229 ops/ms` for 4.1 with `242 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlockingWithMultipleTypes`, right?
   > 
   > Exactly. This tries to bring the code closer to what we had in 4.0, as I had to revert one of the performance improvements we had there.
   > 
   > BTW, answering your other question: "Is there a real-life use case where we heavily create queues".
   > 
   > The answer is yes, we do. Basically, that patch for 4.0 was breaking a scenario for an user that was heavily creating queues.
   
   If so if you check well the second case is better with Camel 4.0 and the first one is slightly better with Camel 4.1 but you have a higher Error `1.146` vs `0.462` which means that the results are more stable in Camel 4.0. 
   
   I'm wondering if an improvement of less than 1 % is insignificant enough to be considered a real improvement as the results may vary a lot from one test to another. 
   
   BTW, I've just realized that you [set forks to 1](https://github.com/apache/camel-performance-tests/blob/main/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SedaRoundTripTest.java#L55), maybe you should retry with 3 to get more reliable results?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702954071

   > > > You mean that we need to compare `925 ops/ms` for 4.1 with `922 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlocking` and `229 ops/ms` for 4.1 with `242 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlockingWithMultipleTypes`, right?
   > > 
   > > 
   > > Exactly. This tries to bring the code closer to what we had in 4.0, as I had to revert one of the performance improvements we had there.
   > > BTW, answering your other question: "Is there a real-life use case where we heavily create queues".
   > > The answer is yes, we do. Basically, that patch for 4.0 was breaking a scenario for an user that was heavily creating queues.
   > 
   > If so if you check well the second case is better with Camel 4.0 and the first one is slightly better with Camel 4.1 but you have a higher Error `1.146` vs `0.462` which means that the results are more stable in Camel 4.0.
   > 
   > I'm wondering if an improvement of less than 1 % is insignificant enough to be considered a real improvement as the results may vary a lot from one test to another.
   > 
   > BTW, I've just realized that you [set forks to 1](https://github.com/apache/camel-performance-tests/blob/main/tests/camel-jmh/src/test/java/org/apache/camel/itest/jmh/SedaRoundTripTest.java#L55), maybe you should retry with 3 to get more reliable results?
   
   Normally that would be the case (i.e.: if we were comparing the results from the same test class). However, these tests are already running on forked executions: the iterations for different versions run separately (as in, the automation runs the tests for one version and then for another - not on the same JVM, I mean).
   
   
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1705977106

   Let's put this one on pause for now. I tried with the suggestions, but the performance wasn't better:
   
   *4.1.0-SNAPSHOT Updated*
   ```
   SedaRoundTripTest.sendBlocking                   thrpt   10  914.608 ±  0.545  ops/ms
   SedaRoundTripTest.sendBlockingWithMultipleTypes  thrpt   10  232.482 ±  0.419  ops/ms
   ```
   
   I'll get back to this one with a clearer head in a couple of weeks, after I dispatch other higher priority items. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on a diff in pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #11279:
URL: https://github.com/apache/camel/pull/11279#discussion_r1313133797


##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaEndpoint.java:
##########
@@ -174,32 +174,41 @@ public PollingConsumer createPollingConsumer() throws Exception {
         return answer;
     }
 
-    public synchronized BlockingQueue<Exchange> getQueue() {
+    public BlockingQueue<Exchange> getQueue() {
         if (queue == null) {
-            // prefer to lookup queue from component, so if this endpoint is re-created or re-started
-            // then the existing queue from the component can be used, so new producers and consumers
-            // can use the already existing queue referenced from the component
-            if (getComponent() != null) {
-                // use null to indicate default size (= use what the existing queue has been configured with)
-                Integer size = (getSize() == Integer.MAX_VALUE || getSize() == SedaConstants.QUEUE_SIZE) ? null : getSize();
-                QueueReference ref = getComponent().getOrCreateQueue(this, size, isMultipleConsumers(), queueFactory);
-                queue = ref.getQueue();
-                String key = getComponent().getQueueKey(getEndpointUri());
-                LOG.debug("Endpoint {} is using shared queue: {} with size: {}", this, key,
-                        ref.getSize() != null ? ref.getSize() : Integer.MAX_VALUE);
-                // and set the size we are using
-                if (ref.getSize() != null) {
-                    setSize(ref.getSize());
+            synchronized (this) {
+                if (queue == null) {

Review Comment:
   Warning, queue is not volatile so this is not thread-safe



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702905110

   > Another question, Is there a real-life use case where we heavily create queues? otherwise, I don't really get the real need of improving it.
   
   The `getQueueReference` is in the hot path for the SedaProducer` `addToQueue`.
   
   > Do you have profiler reports indicating that this part of the code as an hot spot?
   
   Absolutely.
   
   <img width="186" alt="Screenshot 2023-09-01 at 17 06 51" src="https://github.com/apache/camel/assets/1851560/9bbc6c5c-f161-47ad-a7fa-122eed41e415">
   <img width="1728" alt="Screenshot 2023-09-01 at 17 07 03" src="https://github.com/apache/camel/assets/1851560/864457c4-bfb0-4c06-8934-2a5f56426132">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702893994

   > Maybe I misunderstood your results, but I don't see a real significant improvement, could you please clarify a bit your results?
   
   The key ones are the top two on each table. They are measured in terms of number of operations per millisecond. Even though the number seems small, when spread over the course of a few minutes/hours, this results in quite a lot more exchanges going through the core.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702911895

   > You mean that we need to compare `925 ops/ms` for 4.1 with `922 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlocking` and `229 ops/ms` for 4.1 with `242 ops/ms` for 4.0 in case of `SedaRoundTripTest.sendBlockingWithMultipleTypes`, right?
   
   Exactly. This tries to bring the code closer to what we had in 4.0, as I had to revert one of the performance improvements we had there. 
   
   BTW, answering your other question: "Is there a real-life use case where we heavily create queues". 
   
   The answer is yes, we do. Basically, that patch for 4.0 was breaking a scenario for an user that was heavily creating queues. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702913875

   Interesting, by chance, do you have the html version of the reports to allow me to zoom in?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702927628

   > Interesting, by chance, do you have the html version of the reports to allow me to zoom in?
   
   Here's one: http://angusyoung.org/arquivos/tmp/profile-camel-19815-with-perf-v6-4.1.0-SNAPSHOT-2023-09-01-043702.html
   
   
   Obs.: just keep in mind that this is just one of the many scenarios I run (and generated from the same JMH results I pasted - it's just the only one I have readily available). If you want a different one (i.e.: uncontended SEDA or etc), drop me a note next week and I can send it to you (or point to how you can generate your own). 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702841623

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :camel: Maintainers, please note that first-time contributors *require manual approval* for the GitHub Actions to run.
   
   :warning: Please note that the changes on this PR may be **tested automatically** if they change components.
   
   :robot: Use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702960239

   > > > Interesting, by chance, do you have the html version of the reports to allow me to zoom in?
   > > 
   > > 
   > > Here's one: http://angusyoung.org/arquivos/tmp/profile-camel-19815-with-perf-v6-4.1.0-SNAPSHOT-2023-09-01-043702.html
   > > Obs.: just keep in mind that this is just one of the many scenarios I run (and NOT generated from the same JMH results I pasted - it's just the only one I have readily available). If you want a different one (i.e.: uncontended SEDA or etc), drop me a note next week and I can send it to you (or point to how you can generate your own).
   > 
   > Thx for sharing do you have the same kind of report for 4.0 (the baseline)?
   
   Not right now, as I am off from work, but on Monday I'll take a look at the review comments you raised (along w/ the ones from @rhuan080), adjust the code and regenerate all the data. I'll post the update report so you guys can look at it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] rhuan080 commented on a diff in pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "rhuan080 (via GitHub)" <gi...@apache.org>.
rhuan080 commented on code in PR #11279:
URL: https://github.com/apache/camel/pull/11279#discussion_r1313160202


##########
components/camel-seda/src/main/java/org/apache/camel/component/seda/SedaComponent.java:
##########
@@ -189,10 +186,27 @@ public synchronized QueueReference getOrCreateQueue(
         log.debug("Created queue {} with size {}", key, size);
 
         // create and add a new reference queue
-        ref = new QueueReference(queue, size, multipleConsumers);
+        QueueReference ref = new QueueReference(queue, size, multipleConsumers);
         ref.addReference(endpoint);
         getQueues().put(key, ref);
+        return ref;
+    }
 
+    private QueueReference getExistingQueueRef(SedaEndpoint endpoint, Integer size, QueueReference ref, String key) {
+        // if the given size is not provided, we just use the existing queue as is
+        if (size != null && !size.equals(ref.getSize())) {
+            // there is already a queue, so make sure the size matches
+            throw new IllegalArgumentException(
+                    "Cannot use existing queue " + key + " as the existing queue size "
+                                               + (ref.getSize() != null ? ref.getSize() : SedaConstants.QUEUE_SIZE)
+                                               + " does not match given queue size " + size);
+        }
+        // add the reference before returning queue
+        ref.addReference(endpoint);
+
+        if (log.isDebugEnabled()) {
+            log.debug("Reusing existing queue {} with size {} and reference count {}", key, size, ref.getCount());
+        }
         return ref;
     }
 

Review Comment:
   Can the 'synchronized' keyword in the 'registerQueue' method also be eliminated? I believe you can utilize 'computeIfAbsent,' as suggested by @essobedo  in the comment above.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #11279: CAMEL-19815: use a ConcurrentHashMap instead of a blanket synchronize

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #11279:
URL: https://github.com/apache/camel/pull/11279#issuecomment-1702956953

   > > Interesting, by chance, do you have the html version of the reports to allow me to zoom in?
   > 
   > Here's one: http://angusyoung.org/arquivos/tmp/profile-camel-19815-with-perf-v6-4.1.0-SNAPSHOT-2023-09-01-043702.html
   > 
   > Obs.: just keep in mind that this is just one of the many scenarios I run (and NOT generated from the same JMH results I pasted - it's just the only one I have readily available). If you want a different one (i.e.: uncontended SEDA or etc), drop me a note next week and I can send it to you (or point to how you can generate your own).
   
   Thx for sharing do you have the same kind of report for 4.0 (the baseline)?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org