On Mon, 22 Feb 2021 20:36:53 GMT, djelinski <github.com+30433125+djelin...@openjdk.org> wrote:
> Actually there's a much easier solution to reduce the number of slow `put()`s > without making any behavioral changes. > The cache object could store the earliest expire time, and then exit > `expungeExpiredEntries()` early when current time is earlier than the > earliest expire time - when it is, we know that there are no expired items in > the queue and we can skip the scan entirely. > @XueleiFan do you think the above is worth exploring? Definitely, I think it is a good improvement. Actually, it is a surprise to me that the current code is not working this way. Sorry, I was/am on vacation, and the review could be delayed for a few days. ------------- PR: https://git.openjdk.java.net/jdk/pull/2255