Bug Report T387145
Visible to All Users

Debugger Visualizer is very slow when debugging code with string literals that contain many double-quotes or CR LF characters

created 9 years ago

Debugging is very slow when CodeRush for Roslyn is activated whenever a variable containing a large string with many double-quotes or endlines is in the scope.  Visual Studio freezes for many minutes and cpu usage is high.

It can be easily reproduced with this code in a console application:

using System;
using System.Text;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main( string[] args )
        {
            StringBuilder sb = new StringBuilder();
            for ( int i = 0; i < 100000; i++ )
                sb.Append( ""x"" );             // Slow
                //sb.AppendLine( "x" );          // Slow
                //sb.Append( "xxx" );              // Not slow

string x = sb.ToString();
            Console.Out.Write( x.Length );
        }
    }
}

Add a breakpoint to line string x =…
Then step over the line.  x will contains the string but the it takes many minutes to reach the Console.out… line.
Replacing the first sb.Append… line by the second gives the same result.  The third one is ok.

CodeRush option to show the values of variables is not enabled.
By disabling completely CodeRush, the problem disappears.

Thanks,
Serge

Comments (1)
DevExpress Support Team 9 years ago

    Serge,

    Thank you for pointing out this issue to us and providing the code sample. I was able to reproduce the problem and passed it to our developers to research.

    Answers approved by DevExpress Support

    created 9 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Comments (2)
      SC SC
      Serge Chouinard 9 years ago

        Thank you for the quick response !

        DevExpress Support Team 9 years ago

          Serge,

          You are welcome, we are here to help you at any time.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.