使用dynamic实现反射,并提交性能

dynamic与反射的性能比较,请参考:

http://www.cnblogs.com/cuitsl/archive/2012/01/06/2314636.html


代码如下:

string cacheInstance = ConfigurationManager.AppSettings["cachedll"];
var assembly = Assembly.Load(cacheInstance);
dynamic instance = assembly.CreateInstance(ConfigurationManager.AppSettings["cachecls"]);
return (ICache)instance;


posted on 2013-01-31 10:42  HTTP500  阅读(165)  评论(0编辑  收藏  举报