Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages<12
Slow unit test runs forever
devdept
#21 Posted : Tuesday, February 26, 2019 7:53:24 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/13/2012(UTC)
Posts: 53
Location: Italy

Was thanked: 2 time(s) in 2 post(s)
Thanks a lot, Remco,

We will proceed to order NCrunch very soon.
devdept
#22 Posted : Monday, June 10, 2019 4:14:29 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/13/2012(UTC)
Posts: 53
Location: Italy

Was thanked: 2 time(s) in 2 post(s)
Hi Remco,

Regarding this, does it mean that afterward code coverage will not be 100% accurate? It would be a big problem for us.

Thanks,

Alberto
Remco
#23 Posted : Monday, June 10, 2019 10:02:14 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,964

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
devdept;13574 wrote:
Hi Remco,

Regarding this, does it mean that afterward code coverage will not be 100% accurate? It would be a big problem for us.

Thanks,

Alberto


Not necessarily. It depends upon the extent to which you use it.

When you suppress code coverage for a region of code, NCrunch won't consider that code to be part of the code coverage calculation. So it won't consider this code to be covered or uncovered (it's considered 'not code').

So if you're doing this for large regions of code, it may have a slight impact on your overall metric, but it won't sway it much in one direction or the other.

Note that it is impossible for any tool to track code coverage without some level of performance impact.
devdept
#24 Posted : Tuesday, June 11, 2019 12:55:24 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/13/2012(UTC)
Posts: 53
Location: Italy

Was thanked: 2 time(s) in 2 post(s)
We love performance impact if reasonable. We would run only a few unit tests instead of thousands. The problem is that some of them run forever.

How would you identify critical code sections?

Thanks,

Alberto
Remco
#25 Posted : Wednesday, June 12, 2019 12:02:58 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,964

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
devdept;13577 wrote:

How would you identify critical code sections?


Sorry, I'm not sure if I understand this question .. are you asking for a better way to find performance bottlenecks in your code?
devdept
#26 Posted : Wednesday, June 12, 2019 6:26:10 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/13/2012(UTC)
Posts: 53
Location: Italy

Was thanked: 2 time(s) in 2 post(s)
Quote:
Sorry, I'm not sure if I understand this question .. are you asking for a better way to find performance bottlenecks in your code?


No bottlenecks in the NCrunch instrumentation, in other words where to place these: https://www.ncrunch.net/...de-coverage-suppression

Remco
#27 Posted : Wednesday, June 12, 2019 10:47:58 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,964

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
devdept;13582 wrote:

No bottlenecks in the NCrunch instrumentation, in other words where to place these: https://www.ncrunch.net/...de-coverage-suppression


Right now the best way I can suggest is to follow the yellow markers. Start from the top of the stack (at the test code), then follow them down through into your code to see where it's running slow. With the nature of your codebase, the likely loss of performance is from the markers themselves, and they'll detect their own performance cost.

We're presently working on a 'hot spots' view that will make this easier to do from a more global perspective. It's still experimental at the moment so I can't promise an ETA on this feature.
devdept
#28 Posted : Monday, June 24, 2019 11:54:24 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/13/2012(UTC)
Posts: 53
Location: Italy

Was thanked: 2 time(s) in 2 post(s)
Hi Remco,

We have a large code base and thousands of yellow marks, I don't know where to start. "Analyse line execution times" turned on or off does not make any difference.
Remco
#29 Posted : Tuesday, June 25, 2019 1:21:22 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,964

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Something you can try is adjusting the performance display sensitivity setting to something a bit higher. You can tweak this so that it only shows yellow markers on lines of code that are extremely slow. This should reduce the clutter somewhat and help to focus on the areas where the performance is most in need of attention.
devdept
#30 Posted : Tuesday, June 25, 2019 6:14:49 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/13/2012(UTC)
Posts: 53
Location: Italy

Was thanked: 2 time(s) in 2 post(s)
Thanks Remco, we have 2400 *.cs file in our solution, shall we check manually each one or is there a better way to follow these yellow marks?
Remco
#31 Posted : Tuesday, June 25, 2019 6:16:20 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,964

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
devdept;13613 wrote:
Thanks Remco, we have 2400 *.cs file in our solution, shall we check manually each one or is there a better way to follow these yellow marks?


Start from the top of the stack, inside your test code. You can follow the yellow markers down through your code. This will give indication of where the code is slow inside your test, then through your production code.
Users browsing this topic
Guest
2 Pages<12
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.055 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download