Bug 3926 - Improve debugging perf with better DebuggerDisplayAttributes
Summary: Improve debugging perf with better DebuggerDisplayAttributes
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-03-15 17:23 UTC by Mikayla Hutchinson [MSFT]
Modified: 2015-03-25 10:12 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2012-03-15 17:23:43 UTC
The classlibs use DebuggerDisplayAttribute in various places to improve debugging. Unfortunately, there are a few that refer to several properties, and therefore cause multiple getter invocations. Since debugger method invocations are extremely expensive, these could have a noticeable effect on performance. We could ameliorate it by using the trick described in this post of using a private property to do the expression evaluation and formatting, and have the DebuggerDisplayAttribute display just that property:
http://blogs.msdn.com/b/jaredpar/archive/2011/03/18/debuggerdisplay-attribute-best-practices.aspx

We may also need to add the ",nq" support to MD.
Comment 1 Marek Safar 2012-05-15 13:42:40 UTC
Where is missing DebuggerDisplayAttribute ?
Comment 2 Mikayla Hutchinson [MSFT] 2012-05-15 14:20:25 UTC
Grep Mono sources, you will see several DebuggerDisplayAttributes that refer to multiple properties. They're not missing, this is a just a suggestions for improving perf by reducing the number of method invocations when displaying such objects.
Comment 3 Marek Safar 2015-03-25 10:12:16 UTC
There does not seem any in mono master