开发者

precompile reflection?

I notice in my unit test the first test with a class using reflection is slow. Is there a way i can tell the compiler these classes will 开发者_运维技巧all be used for reflection so precompile it now so it wont lag during runtime? (I run these unit test often.)


I am not sure about being able to "precompile" individual classes. Maybe if they are all grouped under a single assembly.

What you could do is to split your tests into categories. One category could be running speed. Run faster tests more often and slower tests less often (leave them running over night or run them just once a day etc.)


To precompile reflection sounds like an oxymoron. How about mocking the slow parts?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜