Performance loss LocationInterceptionAspect when upgrading from 4.1.30 to 5.0.54

sjoerde's Avatar

sjoerde

09 Aug, 2018 08:30 AM

Hi,

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,
Sjoerd

(4.1.30)

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

(5.0.54)
...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

    Hello,

    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,
    Daniel

  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,
    Sjoerd

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

    PostSharp Technologies's Avatar

    Hello,

    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: https://www.postsharp.net/support/policies

    Best regards,
    -alex

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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