On Mon, 22 Feb 2021 21:31:21 GMT, Xue-Lei Andrew Fan <xue...@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?
>
>> 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.

ping @XueleiFan, I'd appreciate another review.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2255

Reply via email to