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

[GitHub] [camel] dk2k opened a new pull request, #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   Fixed performance related issue "class types should be compared with == or !=,  and not with equals()". PR for 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 #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   Alright, let's close this one. 


-- 
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 #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   Is this still relevant? I think we can close this one ...


-- 
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 #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   A few things
   
   >  I suspect some ambiguity here. It's Object.equals(Object) which I changed in this PR. 
   
   There is not implementation of [`Class.equals`](https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/share/classes/java/lang/Class.java). It resolves to `Object.equals`. (And I am not talking about `Objects.equals(Object, Object)` at all.
   
   As requested, please use JMH for providing data for micro-benchmarks. The code for your benchmark is wrong (i.e.: not taking into account a huge amount of complex behavior that JVM has that can affect the result - please read the JMH documentation to understand why).


-- 
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] dk2k commented on pull request #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   @orpiske I suspect some ambiguity here. It's Object.equals(Object) which I changed in this PR. And it Objects.equals(Object, Object) introduced in java 11 - I didn't change these calls. Oracle loves such questions in Java SE exams.
   Dedicated new benchmark: https://gist.github.com/dk2k/505226619b28a693041c1197b427dea4
   
   Sample timings:
   time for Class.equals(Class)          52
   time for Objects.equals(Class, Class) 11
   time for Class == Class               8
   
   time for Class.equals(Class)          90
   time for Objects.equals(Class, Class) 9
   time for Class == Class               8
   
   time for Class.equals(Class)          68
   time for Objects.equals(Class, Class) 9
   time for Class == Class               6
   
   time for Class.equals(Class)          89
   time for Objects.equals(Class, Class) 9
   time for Class == Class               7
   
   So, I think the proposed changes are still relevant. Objects.equals() can be considered an option as well


-- 
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 #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   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] github-actions[bot] commented on pull request #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
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] davsclaus commented on pull request #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

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

   Yes I think we can close this. Also when using `==` then you may have classloading issues to consider when running on other runtimes like OSGi based and whatnot.


-- 
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 #9838: Fixed performance related issue "class types should be compared with == or !=, and not with equals()". PR for core

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske closed pull request #9838: Fixed performance related issue "class types should be compared with == or !=,  and not with equals()". PR for core
URL: https://github.com/apache/camel/pull/9838


-- 
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