开发者

Reduce PostSharp compile time overhead

We recently introduced PostSharp into our code base and the compi开发者_JAVA百科le time of our ASP.NET MVC project has doubled to quadrupled. We have about 3 MVC projects and approximately 8 class library projects in our solution.

Obviously there will be overhead associated with PostSharp since it is modifying the MSIL code. But a 2x to 4x overhead is quite an overhead.

Is this typical with PostSharp?


For the assemblies where you are sure that PostSharp will not perform any injection you can add the flag SkipPostSharp in the Conditional compilation symbols on the Build Tab for the project.

Hope this helps.


A typical overhead of 2x is normal. The most important way to speed up PostSharp 1.5 is to use ngenned images (the setup program does it for you). In PostSharp 2.0, ngenned images are not considered that important any more.

If you really have an overhead of 4x with PostSharp 2.0, I would like to make some performance analysis of your case.


For Visual Studio for Mac Community edition v8.10, this can be done under Project -> Options -> Compiler -> Define Symbols -> add SkipPostSharp into the ';' separated list

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜