Disable the quanta
feature by default
#482
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR disables the
quanta
feature by default.If it is manually enabled,
quanta::Instant
will be used for some performance critical operations in the cache instead ofstd::time::Instant
.The
quanta
crate is a high performance time measurement library and will be great for some use cases such as collecting performance metrics.moka
used to usequanta::Instant
all over the place by default. However,quanta
is not very good for tracking cache entry expiration times because the time measurement can drift over time and it may not be monotonic on some specific hardware (#472). Therefore, usingstd::time::Instant
is more appropriate for tracking entry expiration times.As of
v0.12.10
, thequanta
feature will not make any noticeable performance difference, but in the future when cache metrics are added, it will be useful to have this feature enabled.