Build/Test Issues

Massive performance difference when using ncrunch

Started by Sakari on 5,639 views

I used to use the Regular visual studio test explorer with the NUnit adapter.
With this, my tests run in usually around 100ms-1sec.
Most tests have a 2 to 10 second builtin timeout when waiting for messages.
So far so good, it all works fine.

I've been evaluating NCrunch, and, after fixing a number of actual problems with my code that NCrunch helped me find (by virtue of working quite differently from the visual studio test runner)
I'm stumbling on something weird, some tests are running for over 15 seconds instead of the old 1 second.
Pretty much all those tests involve my SRP implementation, which is used to implement a secure handshake.

It seems that NCrunch has a lot of trouble getting through some BigInteger maths in unit tests in a timely fashion, if I remove all the timeouts, the tests actually run fine, but take 20-30 seconds to run instead of their usual time.

Is there anything in NCrunch that might slow down things so massively ?

Edit, after some checking it seems almost all of the extra time is spent in the following loop:
https://bitbucket.org/palmstonegames/srp/src/132b02ffad178c606bc4b72e8e416df1fb9521e1/SRP/BigInteger.cs?at=master#cl-2042

Edited

Hi, thanks for posting!

This is probably being caused by the added weight of NCrunch's instrumentation. There are several ways you can solve this, although they all involve making some trade off. This documentation page may help you here.

Cheers,

Remco
Thank you, removing instrumentation for the Crypto related assembly indeed fixed the issue :)
Great stuff! Thanks for letting me know, and I wish you a great new year :)

Cheers,

Remco

Post a reply

Log in to reply.