Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make IMemoryCache fully generic to avoid boxing #48455

Closed
roji opened this issue Feb 18, 2021 · 3 comments
Closed

Make IMemoryCache fully generic to avoid boxing #48455

roji opened this issue Feb 18, 2021 · 3 comments
Labels
Milestone

Comments

@roji
Copy link
Member

roji commented Feb 18, 2021

I was surprised to see that IMemoryCache is a non-generic API, meaning that both keys and values box if they're value types, leading to unnecessary allocations. This showed up when profiling EF Core, where we took care to have a value type key.

/cc @ajcvickers

@roji roji added tenet-performance Performance related issue area-Extensions-Caching labels Feb 18, 2021
@ghost
Copy link

ghost commented Feb 18, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan, @michaelgsharp
See info in area-owners.md if you want to be subscribed.

Issue Details

I was surprised to see that IMemoryCache is a non-generic API, meaning that both keys and values box if they're value types, leading to unnecessary allocations. This showed up when profiling EF Core, where we took care to have a value type key.

/cc @ajcvickers

Author: roji
Assignees: -
Labels:

area-Extensions-Caching, tenet-performance

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 18, 2021
@maryamariyan maryamariyan removed the untriaged New issue has not been triaged by the area owner label Mar 4, 2021
@maryamariyan maryamariyan added this to the Future milestone Mar 4, 2021
@maryamariyan
Copy link
Member

Related to #48567

cc: @adamsitnik

@adamsitnik
Copy link
Member

Since #48567 includes this proposal and some other good ideas I am going to close it as a duplicate.

@adamsitnik adamsitnik closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants