-
-
Notifications
You must be signed in to change notification settings - Fork 999
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
refactor(module: select): use Func to get or set value instead of reflection #1168
Conversation
@Zonciu I am not a reflection and expression tree expert, so correct me if I am wrong. My understanding after having a very brief look at your code, is that you are still using reflection, but instead of every time, you basically "compile" it on set and when it is used, it is just using compiled code instead of going through reflection again. This is where your performance boost is coming from. So we may loose a bit more time during first rendering, but gain time on every item processing when value/label is required to be extracted to set. |
@anddrzejb You are right, and we can make it go further if it is necessary: caching |
Sounds really cool. I have seen reflection quite often used in other components (for example Maybe you could propose your caching idea here as well in the meantime? |
I will create a Func cache commit for this. Actually I have made a helper for property accessing, it works on |
…lection (ant-design-blazor#1168) * refactor(module: select): use Func to get or set value instead of reflection * refactor(module: select): add delegate cache * chore: add DelegateCacheKeyComparer Co-authored-by: James Yeung <shunjiey@hotmail.com>
…lection (#1168) * refactor(module: select): use Func to get or set value instead of reflection * refactor(module: select): add delegate cache * chore: add DelegateCacheKeyComparer Co-authored-by: James Yeung <shunjiey@hotmail.com>
…lection (#1168) * refactor(module: select): use Func to get or set value instead of reflection * refactor(module: select): add delegate cache * chore: add DelegateCacheKeyComparer Co-authored-by: James Yeung <shunjiey@hotmail.com>
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge