Help with performance issue in code editor with R# 6.1

Dec 31, 2011 at 2:28 AM

Let me know what I can do to help. Thanks.

Dec 31, 2011 at 7:47 AM

I also have performance issues with Stylecop 4.7 plugin for resharper. What information can I provide you to investigate this problem?

Coordinator
Dec 31, 2011 at 11:29 AM
Edited Dec 31, 2011 at 2:53 PM
It seems theres a bug/change in r# 6.1 that means the error collector is not always returning errors when the current code pane won't compile.
This causes stylecop to run even though the code won't compile.
I've reported the problem to my JetBrains Dev contacts.
When they have fixed it in r# I can patch stylecop - until then I can't fix it.
Sorry.
A.
Jan 3, 2012 at 1:31 AM
Edited Jan 3, 2012 at 1:32 AM

I downloaded the nightly of 6.1.1 and it is a little better. Still not as good as before. I assume that it will get better. The lag is not near as bad as before.

It is Build 6.1.38.146 on 2011-12-30T18:18:32.

Coordinator
Jan 3, 2012 at 9:43 PM
Edited Jan 3, 2012 at 9:43 PM

Anyone having issues with performance of 6.1 I've been asked by the JetBrains Dev Team to point you towards http://confluence.jetbrains.net/display/ReSharper/ReSharper+Profiling+Instructions

Jan 4, 2012 at 3:17 PM

I have created a profile and uploaded it and created an incident. Let me know if I can help further. Thanks.

Coordinator
Jan 5, 2012 at 5:29 PM

New build of StyleCop 4.7 is imminent. Please re-confirm any perf issues. Note. 4.7 needs R# 6.1.1 from http://confluence.jetbrains.net/display/ReSharper/ReSharper+6.1.1+Nightly+Builds

Jan 6, 2012 at 2:30 PM

I can confirm the issue is still there. The ReSharper team is looking into the profile and bug report I gave them.

Coordinator
Jan 6, 2012 at 3:00 PM

@vincentw56: Can you add a link to the R# issue you've opened please so I can follow up too?

Jan 6, 2012 at 3:19 PM
Edited Jan 6, 2012 at 3:20 PM

Here you go: http://youtrack.jetbrains.net/issue/RSRP-287595?projectKey=RSRP

Thanks,

Vincent

Coordinator
Jan 6, 2012 at 3:39 PM

If you're now using StyleCop 4.7.1 can you go to ReSharper->Options->Tools->StyleCop and check the perormance setting at the bottom please? It should be on about 7 out of 9 by default. Drop it to 3-4 (over to the left) and then re-test please.

Jan 6, 2012 at 5:53 PM

I have installed StyleCop 4.7.1 and ReSharper 6.1.1. I dropped the performance setting and it is the same. No change on the lag when typing.

Coordinator
Jan 6, 2012 at 6:09 PM

Hmm. Any other plugins enabled? Go into ReSharper->Options-> Plugins and turn off StyleCop 4.7.1.0. Then check for me please - just to be sure.

Jan 6, 2012 at 6:43 PM

No other plugins, just this one. Turned it off and typing is responsive just like it should be. Turned it back on and there was a lag.

Coordinator
Jan 6, 2012 at 6:46 PM

So here's the thing. In 4.7.1.0 if you srop the performance right over to the left it will only alanayse the codefile a maximum of once every 10 seconds. So the lag can't be in StyleCop or the plugin. (As you type R' calls the plugin but the timer says have I executed in the last 10 secs and if so exits immediately.)

Drop the performace to minimum and the type. It should update the analysis every 10 secs or so and so thats when you should feel it lag.

Jan 6, 2012 at 6:52 PM

Didn't make a difference. If I turn the plugin off, typing is just fine. Maybe it is something with their plugin interface and not the plugin itself. Guess we will see what they say when they look at the profile I generated.

Coordinator
Jan 6, 2012 at 6:53 PM

OK. Lets see where they get to. If still an issue I can do a debug build for you that'll generate a log file with all the timings in it.

Jan 6, 2012 at 7:12 PM

Ok, if you want to do that anyway, I would be more than happy to test. Thanks.

Coordinator
Jan 6, 2012 at 7:20 PM
Edited Jan 6, 2012 at 7:26 PM

I'm building the debug build now. Instructions are at http://stylecop.codeplex.com/wikipage?title=EnablingTracing

 

I've uploaded 4.7.2.0-debug.msi. Please use that and send me a log.

And thanks for helping.

Jan 6, 2012 at 8:05 PM

Okay, I got a trace file. How do I get it to you?

Coordinator
Jan 6, 2012 at 8:59 PM

send to andy at stylecop dot com please

Jan 10, 2012 at 9:54 AM

@Andy
Whats going on here? The typing performance is so poor.
What can we do? 

Coordinator
Jan 11, 2012 at 7:20 PM
Edited Jan 11, 2012 at 7:20 PM

Have you tried 4.7.4.0.

ReSharper -> Options-> Tools ->StyleCop and turn the analysis right down (slider bar to the left)?

The reason I ask I s I have some people here not reporting the issue.

Jan 11, 2012 at 9:32 PM
Edited Jan 11, 2012 at 9:33 PM

Yes, same with 4.7.4.0!

I try the analysis performance from less to more resources...always the same delay! I can't coding. It's so slow. When i disable stylecop, it's normal performance!!Only why?

Coordinator
Jan 11, 2012 at 9:45 PM

I dont know. Fro mthe perf logs I've been sent I'm not seeing any delay in the StyleCop code. For example: 

2012-01-07 00:18:34Z : PB = 593801216 : In   : ------------- StyleCop.CSharp.CsParser.ParseFile(sourceCode=[StringBasedSourceCode], passNumber=0, document=<null>)
2012-01-07 00:18:34Z : PB = 594632704 : In   : -------------- StyleCop.StyleCopThread.DoWork(sender={System.ComponentModel.BackgroundWorker}, e=[DoWorkEventArgs])
2012-01-07 00:18:34Z : PB = 593674240 : In   : ----------- StyleCop.StyleCopThread.DoWork(sender={System.ComponentModel.BackgroundWorker}, e=[DoWorkEventArgs])
2012-01-07 00:18:34Z : PB = 594493440 : In   : ----------- StyleCop.StyleCopThread.DoWork(sender={System.ComponentModel.BackgroundWorker}, e=[DoWorkEventArgs])
2012-01-07 00:18:34Z : PB = 594632704 : In   : ----------- StyleCop.StyleCopThread.DoWork(sender={System.ComponentModel.BackgroundWorker}, e=[DoWorkEventArgs])
2012-01-07 00:18:34Z : PB = 594493440 : Out  : -------------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594632704 : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594632704 : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594632704 : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594632704 : Out  : -------------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594632704 : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594632704 : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594632704 : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 594636800 : Out  : ------------- StyleCop.CSharp.CsParser.ParseFile()=False
2012-01-07 00:18:34Z : PB = 594636800 : In   : ------------- StyleCop.StyleCopThread.TestAndRunAnalyzers(document=[CsDocument], parser=[CsParser], analyzers=[<get_EnabledAnalyzers>d__0], passNumber=0)
2012-01-07 00:18:34Z : PB = 594636800 : In   : -------------- StyleCop.StyleCopThread.RunAnalyzers(document=[CsDocument], parser=[CsParser], analyzers=[<get_EnabledAnalyzers>d__0])
2012-01-07 00:18:34Z : PB = 594636800 : Out  : -------------- StyleCop.StyleCopThread.RunAnalyzers()
2012-01-07 00:18:34Z : PB = 594636800 : Out  : ------------- StyleCop.StyleCopThread.TestAndRunAnalyzers()=True
2012-01-07 00:18:34Z : PB = 594817024 : Out  : ------------ StyleCop.StyleCopThread.ParseAndAnalyzeDocument()
2012-01-07 00:18:34Z : PB = 595443712 : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2012-01-07 00:18:34Z : PB = 595443712 : Out  : ---------------- StyleCop.StyleCopCore.RunWorkerThreads()=True
2012-01-07 00:18:34Z : PB = 595755008 : Out  : --------------- StyleCop.StyleCopCore.Analyze()
2012-01-07 00:18:34Z : PB = 596066304 : Out  : -------------- StyleCop.StyleCopCore.FullAnalyze()
2012-01-07 00:18:34Z : PB = 596377600 : Out  : ------------- StyleCop.ReSharper61.Core.StyleCopRunnerInt.RunStyleCop()
2012-01-07 00:18:34Z : PB = 596688896 : Out  : ------------ StyleCop.ReSharper61.Core.StyleCopRunnerInt.Execute()

It does appear that ReSharper is calling the addin more frequently than before though.

Jan 12, 2012 at 5:00 AM

Same here. Much slower performance, lagging while I'm typing.

Also, inspection for empty line before closing braket often glitches. After I remove line it shows warning still unless I go to that brace, press enter and delete.

Coordinator
Jan 12, 2012 at 5:15 AM
Edited Jan 12, 2012 at 2:14 PM
Can some more people please send me a source file and a complete repro so I can see it here. Whatever I can do to fix I will.
A.


Jan 12, 2012 at 5:23 AM

How do I attach image here? Or can you send me your email so I can send you screenshot showing what it is doing?

Coordinator
Jan 12, 2012 at 11:21 AM
Edited Jan 12, 2012 at 2:14 PM
My email is in the thread I think.
Andy at stylecop dot com


Coordinator
Jan 14, 2012 at 2:52 PM

4.7.5.0 has been uploaded a few minutes ago.

A couple of points. There's the usual release version  and also a 4.7.5.0-debug version. Fro anyone helping me investigate peformance issues in R#6.1 please install the debug version and follow the instructions on sending me log files. Alos make sure you tell me what you were doing when you started vs, did some actions and then sent the logs. 

There's also a new option in R# StyleCop options window to turn off analysis as you type completely. If you're having the performance issue keep the plugin turned on and try switching this checkbox off and see if its better or worse please.

Thanks for your help.

Jan 14, 2012 at 8:15 PM

Hi Andy,
please do not ask me, but with your release 4.7.5.0 the performance issue is done... Nice!
The only difference on my system is, that the last 24 hours my computer was turned on.
Many thanks! 

Jan 16, 2012 at 3:13 AM

I have installed 4.7.5.0 and after using it for a day it feels as if the performance issue has been resolved. The lag associated with having the plugin enabled in R#6.1 seems to have disappeared.

Jan 16, 2012 at 3:47 AM

I too can say that it works much better. I don't see a lag at all now. Thanks.