Click here to Skip to main content
15,881,687 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionERROR IN .NET FRAMEWORK - in Windows 10 - how to solve this? Pin
S3TH_201920-Oct-19 0:22
S3TH_201920-Oct-19 0:22 
AnswerRe: ERROR IN .NET FRAMEWORK - in Windows 10 - how to solve this? Pin
Eddy Vluggen20-Oct-19 2:29
professionalEddy Vluggen20-Oct-19 2:29 
GeneralRe: ERROR IN .NET FRAMEWORK - in Windows 10 - how to solve this? Pin
S3TH_201920-Oct-19 10:21
S3TH_201920-Oct-19 10:21 
GeneralRe: ERROR IN .NET FRAMEWORK - in Windows 10 - how to solve this? Pin
Eddy Vluggen20-Oct-19 10:28
professionalEddy Vluggen20-Oct-19 10:28 
GeneralRe: ERROR IN .NET FRAMEWORK - in Windows 10 - how to solve this? Pin
Dave Kreskowiak20-Oct-19 13:30
mveDave Kreskowiak20-Oct-19 13:30 
Question2D Arrays Pin
LilJokez_Gaming10-Oct-19 11:29
LilJokez_Gaming10-Oct-19 11:29 
AnswerRe: 2D Arrays Pin
Dave Kreskowiak10-Oct-19 13:42
mveDave Kreskowiak10-Oct-19 13:42 
QuestiondotNET performance surprises Pin
kalberts20-Sep-19 1:57
kalberts20-Sep-19 1:57 
To illustrate backtracking to a colleague, I wrote a small sudoku solver. To measure its performance I added a counter of how many attempts it makes to place a digit. (For the most difficult problem I have found until now, it makes more than 57 million attempts.)

What did not surprise me: Building for x86 or x64 does not affect execution time significantly; nothing in the code benefits from greater word size. The average time to place a digit and evaluate its validity takes about 11-12 ns. (If anything surprised me, it would be that it is that fast!). Building for "Any CPU" gave similar timings, which didn't surprise me either: dotNET does a JIT compilation to native code. This backtracking core makes no use of libraries or other "external" resources, nothing to slow it down by dotNET overhead.

Nor was I surprised to see that compiling for debug mode slowed down execution by a factor of approximately 2.5, to around 30 ns/attempt, for all three CPU alternatives. I don't know the details of what happens in debug mode, but assume that e.g. code optimization is more or less turned off.

Then comes the surprise:

I took the code home to my home machine. The CPU is a few years older (a 2014 vintage i7-5820K@3.3GHz), so I expected that it would be slower than my office PC (an i7-7700@3.6GHz). Not much! Less than 10%, for all three CPU alternatives in Debug mode. And for x86 and x64 in Debug mode.

But for "Any CPU", the loop time is about 31-32 ns per attempt regardless of whether I build in Release mode or Debug mode. How come? Why is the execution time cut by 60% at my office PC, but not at my home PC? Even at my home PC, it is cut by 60% when I build for x86/x64, it is only the "Any CPU" alternative that seems to insist on Release being just as slow as Debug.

Why is that?

I copied all the project files to my home computer, so all settings should be the same. I build for dotNET 4.7.1 on both machines.

There are two differences, though.

First: At home, I use the "Community" edition of VS2017, while at work I use VS2017 Professional. But if the philosophy is that "To get that optimized speed, you must pay for Visual Studio", why do I get the optimization for x86/x64 in the (free) Community version? Both VS installations are fully updated to 15.9.16.

Second: At home I still run Windows 7 (yes, I know, I know...). But how could the OS version affect a tight, CPU only, code loop that makes no external calls? And only if the code is compiled from a dotNET assembly, not for native x86/x64 code doing exactly the same thing?

Can there be anything in some initialization/configuration file (not in any project file) saying that optimizations should not be performed when compiling for Any CPU? In theory, it could even be in the JIT code generator in the dotNET runtime, but a factor of 2.5 is so large that I am more tempted to think that the optimization is done at a higher level - you don't have that much flexibility in the code generation phase (when the CPU architecture is given).

Is the culprit the OS or the Community version of VS? Or have I overlooked some essential factor?
AnswerRe: dotNET performance surprises Pin
Gerry Schmitz20-Sep-19 5:45
mveGerry Schmitz20-Sep-19 5:45 
QuestionPowerShell - FileSystemWatcher with GUI issue Pin
Damian Bz10-Sep-19 22:48
Damian Bz10-Sep-19 22:48 
AnswerRe: PowerShell - FileSystemWatcher with GUI issue Pin
Gerry Schmitz11-Sep-19 16:26
mveGerry Schmitz11-Sep-19 16:26 
GeneralRe: PowerShell - FileSystemWatcher with GUI issue Pin
Damian Bz11-Sep-19 22:23
Damian Bz11-Sep-19 22:23 
AnswerRe: PowerShell - FileSystemWatcher with GUI issue Pin
shreya313-Oct-19 2:17
shreya313-Oct-19 2:17 
QuestionForm appears hidden behind google maps in expanded mode. Pin
BibiStars6-Sep-19 4:11
BibiStars6-Sep-19 4:11 
AnswerRe: Form appears hidden behind google maps in expanded mode. Pin
dan!sh 6-Sep-19 4:44
professional dan!sh 6-Sep-19 4:44 
GeneralRe: Form appears hidden behind google maps in expanded mode. Pin
BibiStars7-Sep-19 3:28
BibiStars7-Sep-19 3:28 
GeneralRe: Form appears hidden behind google maps in expanded mode. Pin
Ryan Elias22-Oct-19 2:35
Ryan Elias22-Oct-19 2:35 
Questionsqlconnection Pin
Nithya MCA25-Aug-19 5:10
Nithya MCA25-Aug-19 5:10 
AnswerRe: sqlconnection Pin
Gerry Schmitz25-Aug-19 11:37
mveGerry Schmitz25-Aug-19 11:37 
QuestionOptimize Directory Parsing and TreeView Population Pin
Harley Burton13-Aug-19 3:16
Harley Burton13-Aug-19 3:16 
AnswerRe: Optimize Directory Parsing and TreeView Population Pin
Richard Deeming13-Aug-19 3:51
mveRichard Deeming13-Aug-19 3:51 
GeneralRe: Optimize Directory Parsing and TreeView Population Pin
Harley Burton13-Aug-19 10:41
Harley Burton13-Aug-19 10:41 
GeneralRe: Optimize Directory Parsing and TreeView Population Pin
Richard Deeming13-Aug-19 22:35
mveRichard Deeming13-Aug-19 22:35 
GeneralRe: Optimize Directory Parsing and TreeView Population Pin
Harley Burton14-Aug-19 4:52
Harley Burton14-Aug-19 4:52 
QuestionWindows Service Installer Problem Pin
Kevin Marois7-Aug-19 6:14
professionalKevin Marois7-Aug-19 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.