3

We recently introduced PostSharp into our code base and the compile 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?

TrueWill
  • 25,132
  • 10
  • 101
  • 150
Jason
  • 4,232
  • 3
  • 23
  • 31

3 Answers3

3

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.

jvanrhyn
  • 2,804
  • 19
  • 14
  • 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 – Piyush Khera Oct 28 '22 at 15:53
2

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.

Rais Alam
  • 6,970
  • 12
  • 53
  • 84
Gael Fraiteur
  • 6,759
  • 2
  • 24
  • 31
0

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

Piyush Khera
  • 467
  • 5
  • 9