-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Reflection caching #28877
Comments
There's is already some caching, for instance if you fetch a single field/property/method all the other fields/properties/methods on the Type are cached internally. This is done using There's other things going on with reflection that also contribute to the overhead, this post explains some of them |
What are the specific reflection operations you would like to run faster? |
GetCustomAttributes, getting and setting values of fields etc. Emitting IL or using expressions is almost always faster than using vanilla reflection. There are many libraries like fasterflect or fastmember solving those performance problems so why couldn't it be faster out of the box? Would be cool |
Some of the potential solutions are discussed in https://github.com/dotnet/corefx/issues/24390 |
Reflection is slow, why isn't it internally cached by default?
The text was updated successfully, but these errors were encountered: