C++ speed is not consistant and C# is. Why?

aewarnick

Well-known member
Joined
Jan 29, 2003
Messages
1,031
This is actually, in my opinion, a very weird happening. I have a c++ program that stretches an image in the entire window and then draws that same image at normal size whereever the mouse moves.

It works great and fast if I have another large program open like VS. But if I just have dev and the program running the drawing is slower than C# is.

But C# remains the same.

Is there something that .net does that my little c++ app does not that could cause that wierdness?
 
Actually, this makes a lot of sense. In C#, the code is compiled
every time before execution, so the only speed hit you will see
in the IDE versus outside the IDE is in the fact that the debugger
is attached to the app. Now Im not sure how VC++ works in
terms of debugging, but it sounds like its doing something slow
while debugging. In any case, the final compiled app will always
be somewhat faster than its debugged counterpart, and you
do not necessarily need to worry about the speed of your app if
its slow in the IDE.
 
Back
Top