ben-manes commented on PR #4540: URL: https://github.com/apache/activemq-artemis/pull/4540#issuecomment-1624526398
Hi, If you do not have a performance reason to switch then staying with Guava's is perfectly fine. I would not use their `asMap().compute` as a wonky implementation given it was added so late (and you don't use it, so that's fine). Guava's is robust but not actively maintained (CacheBuilder's JavaDoc recommends Caffeine). The most common cause for tests to fail during a migration is that Caffeine switches eviction and listeners to be executed async by default, whereas Guava piggybacks on the calling thread. You can emulate that using `Caffeine.executor(Runnable::run)` if desired. The problem is that often tests assumed no concurrency (immediate eviction or callbacks invoked) and that is no longer a valid assumption. In both cache's their internal logic is very inexpensive (e.g. LRU reordering), but we do not know the cost of the user's callback. Since the JVM now offers shared threads and Caffeine offers an AsyncCache, defaulting to async to minimize user-facing latencies seemed like a reasonable choice. There are other subtle differences, such as if assuming lru eviction order, so you might want to review this [migration page](https://github.com/ben-manes/caffeine/wiki/Guava). Whatever you decide to do is fine with me. Feel welcome to reach out if you have any questions or concerns. -- 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]
