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

[mono] Add a managed cache for flags in RuntimeType. #78840

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

vargaz
Copy link
Contributor

@vargaz vargaz commented Nov 24, 2022

No description provided.

@vargaz
Copy link
Contributor Author

vargaz commented Nov 24, 2022

This will fix:
#78821
and will probably speed up a bunch of other benchmarks.

{
TypeCache cache = Cache;
if ((cache.Cached & (int)TypeCacheEntries.TypeAttributes) != 0)
return cache.TypeAttributes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to work with hot-reload?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If hot reload can change the information that is cached here, then we need a way to either disable this, or a way to invalidate the cache. There is already a cache with some entries which could be affected by this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue #50978 to add a MetadataUpdateHandler for mono to clear reflection caches. (we also have caching in native that we need to clear, and that's not done yet, too). /cc @fanyang-mono

@kotlarmilos
Copy link
Member

Significant size improvement in Blazorwasm sample app

Screenshot 2022-12-13 at 10 29 12

@vargaz
Copy link
Contributor Author

vargaz commented Dec 13, 2022

Not sure that its related to this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants