stataru8 commented on PR #564:
URL: https://github.com/apache/felix-dev/pull/564#issuecomment-5955464874

   Hello, thanks for taking the time to check this PR.
   
   > Are the changes made measurable when ran in isolation in a red/green 
fashion? I would assume Object.hashCode would be highly optimised already
   
   Yes, it's measurable, but only in a specific JVM state. All the details are 
in [FELIX-6863](https://issues.apache.org/jira/browse/FELIX-6863).
   
   For the red/green comparison, the ticket has a reproducer with before/after 
numbers in the same scenario:
   |Kars installed|feature:uninstall before restart|after restart|after 
restart, with the fix|
   | -------- | -------- |-------- | -------- |
   |1|~1.3s|~2.3s|~1.4s|
   |300|~4s|~22s|~3.5s|
   
   
(https://issues.apache.org/jira/secure/attachment/13084874/feature-uninstall-measurements_300_kars.md)
   
   You're right that `Object.hashCode` is normally very cheap. What I observed 
is that after a JVM restart, it can end up on a much slower path when called 
from `ResourceImpl.hashCode`: in the JFR recordings, almost all samples of the 
features thread are inside the native `Object.hashCode`, called from 
`ResourceImpl.hashCode`. My understanding is that this depends on how the JIT 
compiled that call site at startup.
   
   
   I first ran into this issue on **Karaf 4.4.6**, and I was able to reproduce 
it on **4.4.11**.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to