0.5.0
Pre-release
Pre-release
Noteworthy Changes
- Waiting tasks are given the refreshed value (492158c)
- Avoid waiting on refresh and back populating cache in
GetOrSetAsync
(bb9031f) - More accurate connection available checking for Redis (1c28388)
MemoryCacheLayer
now usesConcurrentDictionary
again (3beacac)CacheSettings
constructor logic has changed - when noStaleAfter
is given, the default value is zero rather than being the same value asTimeToLive
. (6dd6b15)
Performance Improvements
CacheStack
, when multiple threads are waiting on a refreshed result, performs about 5% fasterCacheStack
, in the caching alternative memory benchmarks, performs significantly better with memory allocations as well as a 6% performance improvement.
Notes
There are some minor memory allocation increases, primarily around going back to using ConcurrentDictionary
for MemoryCacheLayer
. However, these changes are somewhat offset from the overall performance increase under heavy load that wasn't possible with the custom locking solution.
With the CacheStack
improvements in the caching alternative memory benchmarks, the allocation bonuses primarily come from not using Task.Run
(bb9031f). Even though those were not called in the benchmark, their presence must have introduced more work in either the state machine or the final IL that made it perform slower.