Unit test performs better when started from ReSharper Test Session???

I have a unit test including a stopwatch measuring the execution time of certain .NET library calls.

I get significantly shorter execution times when I start the unit test from ReSharper Test Session in contrast with starting the exact same test from Visual Studio Test Explorer. By significantly I mean half, execution time when started from ReSharper is half the execution time when started from VS Test Explorer.

My question is → what's causing the difference?

ReSharper:

  • 0003: [Time: _______406 ms] - EXPR
  • 0002: [Time: _______359 ms] - MSIL
  • 0001: [Time: _______297 ms] - Typed

VS Test Explorer:

  • 0003: [Time: _______781 ms] - EXPR
  • 0002: [Time: _______688 ms] - MSIL
  • 0001: [Time: _______641 ms] - Typed

Everything is compiled in Release mode
The measured code is not implemented in the unit test, the test only invokes the measure functions from a compiled assembly

I created a console application executing the same test → measured execution times are similar to VS Test Explorer.

What does ReSharper Test Session runner do to achieve better performance than a regular .NET console application?

0
2 comments

Hello,

ReSharper uses its own test runner to run tests, hence the difference. 

0

Do you know what exactly the ReSharper test runner does that results in a better performance than the same library calls compiled into a regular .NET console application in release mode and run from the console?

0

Please sign in to leave a comment.