thomas-gantenbein-tga commented on PR #22311:
URL: https://github.com/apache/camel/pull/22311#issuecomment-4209428797

   > I agree with @gnodet that the LRUCache is to be improved/fixed. We use 
this elsewhere in Camel.
   
   Yes, it's used in a whole lot of places in Camel, that's why I hesitated to 
"fix" it. There's a lot of stuff going on about performance (CAMEL-21888), 
concurrency issues (CAMEL-22176), soft caching (CAMEL-20039) and other stuff in 
there that I don't find as "simple" as the name of `SimpleLRUCache` suggests.
   
   For example: Say I "fix" the SimpleLRUCache by overriding the "remove" 
method and iterating over the `AtomicReference<Deque<Entry<K, ValueHolder<V>>>> 
lastChanges` to remove an entry from both the `Map<K, ValueHolder<V>> delegate` 
and that `lastChanges` Deque: That might well introduce a performance problem 
at a different place, wouldn't it?
   
   So personally, I kind of agree with the AI analysis part that says "do 
both": use that LinkedHashMap where "least recently used" semantics adds 
overhead but no benefits (that I see, at least) and fix the ghost entry problem 
in the SimpleLRUCache as well.
   
   Let me know if any other comments from my side are welcome or if you'd like 
to take this into your own hands from now on.


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