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
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.