Timings missing from continuations in async method

andy.clarkeandy.clarke Posts: 3
edited August 2, 2015 5:39PM in ANTS Performance Profiler 9
I have an async method that is being profiled.

The code is something similar to
var data = await GetDataSource(); // this is timed
var processor = new ReportDataProcessor(); 
var processTask = processor.ProcessAsync(data); // not timed
await dataSource.Complete;
await result;
await WriteReportData(processor.ToReportData()); // not timed

When I profile this method, timing only proceeds to the the GetDataSource method. When I search for the ReportDataProcessor class, ProcessAsync or in fact any of the code further down, there are no results. There are multiple cases elsewhere in the solution where code that is executed in async continuations is not being profiled.

If I change the code to using ContinueWith(...) instead of async/await the profiler will profile the continuations correctly

Comments

  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi Andy,

    Thanks for your post and so sorry for the long delay!

    Regarding this issue, can you kindly do a quick check--if you profile using one of the "All methods inc. framework" modes and from the results, look at the methods grid with "All methods" chosen from the display options--do you see the other methods listed there? If they still don't appear, can you please try disabling "Profile with async awareness" from Tools>Advanced options and then profile again to see if the missing methods then appear?

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • Hi Jessica

    Yes, if I turn off async-aware, these methods reappear.

    Cheers,
    Andy
Sign In or Register to comment.