HttpContext.Cache vs Reflection: Which is More Efficient?
In general, Reflection is not recommended when speed is reached, but you should consider the design time of a cache that actually works (thread safe, very fast, which gives you the current value, not the old inconsistent value) and debug it.
It is very difficult to say which architecture will give the best performance, but you can easily write a small test running two different scenarios with a small set of simple cases. You may find that the speed has not changed at all, or that it differs significantly. In any case, you have your answer.
source to share
this answer comes a little late, but I recently thought about one bit in the project myself and ended up making the cache using the following extension method GetOrCreate don't forget to lock the dictionary if you do.
You can use ImmutableAVLTree instead using lock-free strategy
Finally, there are some useful utilities to use reflection here
This is part of the complete structure, but you can just copy that bit of code if that's the only bit you need.
source to share