-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-Extensions-Optionshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue
Milestone
Description
| return _cache.GetOrAdd(name, () => _factory.Create(name)); |
It could be avoided if the delegate is a member, or simply Add a TryGetValue call before calling GetOrAdd.
The object allocation is much more expensive than the getting itself, when CurrentValue/Get is used in hot code path, the cost will be unexpected.
Metadata
Metadata
Assignees
Labels
area-Extensions-Optionshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue