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

Adding caching and performance improvements to the mapping and reflection #20

Open
Frozenthia opened this issue Dec 30, 2019 · 0 comments

Comments

@Frozenthia
Copy link

Frozenthia commented Dec 30, 2019

An immediate performance improvement would be to cache the PropertyInfo and setter as a delegate and the attributes for the target POCO, like how HyperDescriptor or FastMember or Fasterflect and the ORM Entity Framework does it.

I'm writing a library that is using some heavy hitting WMI queries and it's the mapping part that's adding a time delay. In my particular business case it goes from .002 to .05 for a particular operation. It's not bad from a human user perspective but it would be nice to keep it in the thousandths of a second range for the operation, because in my particular use case and code architecture I can't use an event watcher and have to run my operation in a tight blocking loop.

Although I don't know how to improve iterating over ManagementObjectCollection. That also adds a heavy delay but that's just WMI. Someone suggests using ManagementClass on MSDN. Also maybe analyzing the target POCO and removing irrelevant properties from the query automatically may be of some use, but the consumer can already handle that.

@Frozenthia Frozenthia changed the title Adding caching and performance improvements to the reflection Adding caching and performance improvements to the mapping and reflection Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant