Hello,
Lately I've doing some performance profiling of an app at work where we use the great SQLiteNetExtensions.
At one of the app's processes, a big insert of records is done into the sqlite DB (there are several relationships between the entities and some of them have a bunch of TextBlobbed properties). About 7k entities are inserted.
So, when profiling the app, the profiler showed that a quite important percentage of time was spent inside the ReflectionExtensions class.
The proposed optimizations consists in caching the results from some .NET Reflection methods' calls like: - GetRuntimeProperty - GetRuntimeProperties - GetCustomAttribute - GetCustomAttributes - IsAssignableFrom
The only drawback I see from this change is in the case where code emission is done at runtime (then it would be bad to cache results for those methods as Types could be modified on-the-fly). But, as your library targets also iOS (and AFAIK code emission is forbidden for iOS' published apps), that should be fine anyway.
That being said, I did a quick test on our app (I cannot share the the test code by the moment, as we built a layer on top of SQLiteNetExtensions that I cannot share), that in our case reduces the mentioned process' time from about 7s to 5s, only introducing this cache change.
If you are interesed in the optimization or want to see how it would look, please just letme know and I'll be glad to do PR :-).
It would be a nice addition. I would leave it enabled by default but with the possibility of disabling it somehow, just in case it breaks something in any scenario.