Closed gruan01 closed 9 months ago
We need accurate timings here for very precise timeouts (some users have ~50ms thresholds), so this isn't something we can readily change without breaking those scenarios. It's a tradeoff of cost vs. prevision overall and the issues are:
In short: I get what you're talking about, and have done similar elsewhere, but it's not a good use case here.
Performance trace show
DateTime.UtcNow
take too many CPU .Message.ctor
assignDateTime.UtcNow
toCreatedDateTime
, but this property seem not so necessary.May be , provide a
ISystemClock
just likeMemoryCacheOptions.Clock
is a good choice, so we can provide a not so preciseUtcNow
to it, ,Performance trace shotcuts: