I have a C# executable built in Visual Studio 2019 which runs 20 times faster with debugging (F5) than without debugging (CTRL + F5) when run within Visual Studio. This happens with both the Debug and Release build options. Running the executable from the command line also produces the 20X slower run time.
That is not a typo above, I realize this is the opposite of what one would normally expect.
Any thoughts as to possible causes or avenues of investigation are welcome.
I am using the ILNumerics package for Matrix math operations, otherwise, pretty basic C# calculations (nothing fancy). Windows 10 Enterprise OS 64-bit.
The solution was to limit the maximum number of threads to 1 by adding the following into my Constructor method.