I am seeing some unexpected behaviour when assigning all but 1 core to either VS, or NCrunch.
It seems like the values are applied backwards.
In this case the logical core 15 is an E-Core, which is non hyperthreaded.
Example 1: Assigning 15 cores to NCrunch, 1 core to VS, and rebuilding solution.
Expected: Build to be slow, mainly activity on VS core.
Actual: Build took 3 seconds, activity on all cores:
Screenshot: Assigned to NCrunch
Example 2: Assigning 15 cores to VS, 1 core to NCrunch, and rebuilding solution.
Expected: Build to be fast, activity over most cores.
Actual: Build took 26 seconds, activity only on NCrunch core:
Screenshot: Assigned to VS
Remco NCrunch Developer
#16830
31 Aug 2023 00:27 UTC
Thanks for sharing this.
Can you try the following and see if this affects your results?
1. Start VS and enable NCrunch
2. Ensure all work has finished (i.e. everything is idle)
3. Open task manager, look for the process called 'VBCSCompiler.exe'. Forcefully terminate it.
4. Rebuild your projects in VS
5. Repeat your performance tests while ensuring NCrunch doesn't run any local builds and is not reset at all
My suspicion is that this is caused by NCrunch assigning its affinity settings to VBCSCompiler.exe, which is a shared build process also used by VS.
Can you try the following and see if this affects your results?
1. Start VS and enable NCrunch
2. Ensure all work has finished (i.e. everything is idle)
3. Open task manager, look for the process called 'VBCSCompiler.exe'. Forcefully terminate it.
4. Rebuild your projects in VS
5. Repeat your performance tests while ensuring NCrunch doesn't run any local builds and is not reset at all
My suspicion is that this is caused by NCrunch assigning its affinity settings to VBCSCompiler.exe, which is a shared build process also used by VS.
Hi Remco,
Using those steps, this time the build was fast and used all cores in both examples.
Using those steps, this time the build was fast and used all cores in both examples.
Remco NCrunch Developer
#16833
31 Aug 2023 06:33 UTC
Thanks for confirming this.
I believe I owe you an apology. When advising you to give NCrunch a single core, I forgot entirely about VBCSCompiler.exe, which as described is shared by both VS and NCrunch. This process has always been somewhat of a troublemaker when it comes to thread affinity. We capture it under NCrunch's cores because otherwise NCrunch's background building steals CPU away from VS. A side-effect of this is that we also end up impacting VS's own builds.
Considering the above, I would recommend doing away with the core affinity and simply assigning ALL cores to both VS and NCrunch when working in grid-only mode. It looks like you have enough cores for both. Better to let the O/S sort it out.
I believe I owe you an apology. When advising you to give NCrunch a single core, I forgot entirely about VBCSCompiler.exe, which as described is shared by both VS and NCrunch. This process has always been somewhat of a troublemaker when it comes to thread affinity. We capture it under NCrunch's cores because otherwise NCrunch's background building steals CPU away from VS. A side-effect of this is that we also end up impacting VS's own builds.
Considering the above, I would recommend doing away with the core affinity and simply assigning ALL cores to both VS and NCrunch when working in grid-only mode. It looks like you have enough cores for both. Better to let the O/S sort it out.
Ok thanks for the advice, I will give that a go.
Post a reply
Log in to reply.