poorbarcode commented on PR #23052: URL: https://github.com/apache/pulsar/pull/23052#issuecomment-2241487669
@ben-manes @lhotari The implementation of Caffeine without `expireAfterWrite/expireAfterAccess` is `com.github.benmanes.caffeine.cache.SSMS`, and it depends on `ConcurrentHashMap`<sup>see pictures below</sup>. So it can never be better than `ConcurrentHashMap`. **`get`** <img width="988" alt="Screenshot 2024-07-21 at 13 46 30" src="https://github.com/user-attachments/assets/8562afdd-2585-49e5-89a7-27d53e4b62b1"> **`get -> load`** <img width="893" alt="Screenshot 2024-07-21 at 13 47 43" src="https://github.com/user-attachments/assets/940ec587-bfa6-432b-b794-ed7f6ed257f5"> @BewareMyPower Thanks for your testing, I think we'd better change the code like the one below(BTW, in my test, both implementations are close to each other) <img width="540" alt="Screenshot 2024-07-21 at 13 52 09" src="https://github.com/user-attachments/assets/2099a951-c203-49bf-a349-5b09a43ce569"> -- 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]
