Performance loss LocationInterceptionAspect when upgrading from 4.1.30 to 5.0.54

sjoerde's Avatar


09 Aug, 2018 08:30 AM


We're trying to upgrade our PostSharp to the latest stable release (from 4.1.30 to 5.0.54) but are running into performance issues. Almost all our performance tests show a loss of about 10%-20%. We haven't needed to upgrade any code to get it to build, only install the new NuGet packages.
After profiling (using sampling) we see that the LocationInterceptionAspect we use to intercept setters now also intercepts the getters, which are called very often.
Below an example of the (distilled-down) stacktraces we see of the previous and the new version, including the 'Inclusive sampling percentage' can be found.
As you can see the LocationInterceptionAspect that used to only intercept the setters is suddenly using its binding framework to add a default interceptor to our getters.
Are we doing something wrong? Is there a 'setter'-only LocationInterceptionAspect? Or is there a setting to tell the compiler not to generate these getter-bindings when we have not implemented them?
Or any other solution that will solve our performance issues.

Thank you in advance,


...get_IsActive [0.36%]
    ...<get_IsActive>z_OriginalMethod [0.33%]
        ...get_Beta [0.12%]
            ...<get_Beta>zOriginalMethod [0.05%]

...get_IsActive [2.06%]
    PostSharp.Aspects.Internals.LocationInterceptionArgsImpl`1[System.Boolean].ProceedGetValue [1.32%]
        ...+<IsActive>cBinding.GetValue [1.29%]
            ...<get_IsActive>zOriginalMethod [1.17%]
                ...get_Beta [0.96%]
                    [clr.dll] [0.38%]
                    PostSharp.Aspects.Internals.LocationInterceptionArgsImpl`1[System.Canon].ProceedGetValue [0.17%]
                    PostSharp.Aspects.Internals.LocationInterceptionArgsImpl`1[System._Canon]..ctor [0.08%]
                    PostSharp.Aspects.LocationInterceptionAspect.OnGetValue [0.03%]
  1. Support Staff 1 Posted by PostSharp Techn... on 09 Aug, 2018 01:05 PM

    PostSharp Technologies's Avatar


    this is a bug of advice optimizations, we will be working on a fix.

    (internal issue #16505)

    Thank you a lot for reporting the problem.

    Best regards,

  2. 2 Posted by sjoerde on 14 Aug, 2018 02:24 PM

    sjoerde's Avatar

    Hello Daniel,

    Thank you for the reply.
    Do you know already if the fix will be in the next release or later?

    Again, thank you very much for looking into it,

  3. Support Staff 3 Posted by PostSharp Techn... on 14 Aug, 2018 02:36 PM

    PostSharp Technologies's Avatar


    We have scheduled this bug fix for the next iteration, which means it's not going to be included in the upcoming release, but in the one after that (up to 6 weeks before the release). More information about our support policies can be found on this page:

    Best regards,

  4. Support Staff 4 Posted by PostSharp Techn... on 22 Aug, 2018 11:01 AM

    PostSharp Technologies's Avatar


    We're closing the ticket for now as the bug has been internally filed as issue #16505. We will contact you as soon as the bug fix has been released.

    For more details on our support policies and prioritization of bug fixes, please visit

    PostSharp Team

  5. PostSharp Technologies closed this discussion on 22 Aug, 2018 11:01 AM.

  6. PostSharp Technologies re-opened this discussion on 17 Sep, 2018 02:28 PM

  7. Support Staff 5 Posted by PostSharp Techn... on 17 Sep, 2018 02:28 PM

    PostSharp Technologies's Avatar


    the bug #16505 has been fixed in the current release of PostSharp 6.0.27 and 6.1.3-preview.

    Should you need further help with this issue, don't hesitate to re-open this discussion.

    Best regards,

  8. PostSharp Technologies closed this discussion on 17 Sep, 2018 02:28 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac