0

My set up is NUnit (latest, 2.6.something), VS13 with R#8 and Win7. I noticed to my great surprise that when I'm using the attribute Combinatorial, the IDE gets extremely, painfully slow. We're talking waiting at the greyed out window of VS for a few seconds after each keystroke!

I've googled that but there seems not to be any relevant hits. I suspect our local setup to blame (how one can fail to install NUnit and R#?!) but it could be of interest for others to know what to do when that happens.

We've noticed that the delay increases exponentially as we increase the number of test cases. This is an example for one of the methods.

[Test]
[Combinatorial]
public void AddWaveformTest(
  [Values(null, "", "sec", "stringThatMayBulky")] string s1,
  [Values(null, "", "sec", "stringThatMayBulky")] string s1,
  [Values(null, "", "sec", "stringThatMayBulky")] string s3,
  [Values(null, "", "sec", "stringThatMayBulky")] string s4,
  [Values(int.MinValue, int.MaxValue, -1, 0, 1)] int i1,
  [Values(null, "", "sec", "stringThatMayBulky")] string s5,
  [Values(null, "", "sec", "stringThatMayBulky")] string s6,
  [Values(null, "", "sec", "stringThatMayBulky")] string s7,
  [Values(null, "", "sec", "stringThatMayBulky")] string s8,
  [Values(int.MinValue, int.MaxValue, -1, 0, 1)] int i2)
{
  ...
}

That's a bit above 26 millions operations, which might be a lot but in computer terms it shouldn't be that bad. Right? I also noticed that it's not that much the Combinatorial attribute that is the direct cause but Values attribute. When I comment out the latter, stuff work again, while commenting out the former brings no improvement...

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
  • 1
    Just a thought but don't you have some fixture setup and teardown that may impact your performance? – samy Jun 25 '14 at 12:30
  • @samy Yes I do have both setup and teardown. The fact that flabbergasts me, though, is that the slow-down occurs **as I type**, after each keystroke - literally! It feel like VS recompiles something in the background for each hit on the keyboard. How is that possible?! And how to kill the problem? – Konrad Viltersten Jun 25 '14 at 19:53
  • You don't have any tooling like ncrunch, or live test integration setup? – samy Jun 25 '14 at 20:04
  • @samy That's a good guess. However, I don't think that's the case. I haven't installed anything like that knowingly, at least. I just installed VS13, R#8 and NUnit2.6. Unless it's automagically added and started, I don't have anything like that on my machine... – Konrad Viltersten Jun 26 '14 at 10:51
  • 1
    Konrad, I think that there may be some continuous testing integrated in R#8, have alook at this http://stackoverflow.com/questions/21445938/resharper-8-1-test-runner-slowing-down-visual-studio-text-editing – samy Jun 26 '14 at 12:08
  • @samy According to the link the issue is resolved in 8.2 (and since I installed a new R#8 just a week ago I'm guessing I've got it), so I'm not sure that's the issue. Never the less, I'll give it a whack tomorrow at work. And - most importantly - great persistence, mate! Very helpful. Post your comment as a reply so I can check it as an answer if it works out. :) – Konrad Viltersten Jun 26 '14 at 21:04

1 Answers1

1

You may want to check this thread as it looks like resharper may have a bug in a 8.x version that causes the problem of the editing window taking some time after each keystroke to respond.

Some areas that were put aside in the comments to the question are:

  • setup and teardown being expensive: this idea was tied with the second point ->
  • some sort of continuous testing exists inside Resharper (sthing like ncrunch capabilities, or approching) but OP doesn't find it likely.

Don't hesitate to come and comment on the problem, I'm very curious about it (btw, does the time during which the editor window is unavailable matches your test duration approximately?)

Community
  • 1
  • 1
samy
  • 14,832
  • 2
  • 54
  • 82
  • The time is actually a bit the same in the two issues. Not sure if there's any significance in that, though. In any case, I'll look into that on Monday at work. +1 for persistance and hintification. :) – Konrad Viltersten Jun 28 '14 at 23:58