473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How does C-Sharp Perform in Large Desktop Applications?

Currently our desktop application is a large VC++ 7.1, Unmanaged, MFC
application.

We are going to be re-architecting our application and we are considering
rewriting it using C-Sharp.

So far, we have written a few pieces of our program in C# that get called
through a managed DLL. But they are used infrequently so the impact on
performance has been minimal. We wrote these pieces in C# because it was
easier to do in the short amount of time we had available. But our
experience with these components has been that the C# stuff tends to be much
more sluggish than the unmanaged MFC code in the rest of the application.

Has anyone out there had experience writing or converting a large desktop
application from MFC to C#?

Performance is a big issue with our users, so we are very concerned about
keeping our application responsive for the users.

--
Thanks,
Bruce
Dec 8 '05 #1
4 2019
Bruce wrote:
Currently our desktop application is a large VC++ 7.1, Unmanaged, MFC
application.

We are going to be re-architecting our application and we are considering
rewriting it using C-Sharp.

So far, we have written a few pieces of our program in C# that get called
through a managed DLL. But they are used infrequently so the impact on
performance has been minimal. We wrote these pieces in C# because it was
easier to do in the short amount of time we had available. But our
experience with these components has been that the C# stuff tends to be much
more sluggish than the unmanaged MFC code in the rest of the application.

Has anyone out there had experience writing or converting a large desktop
application from MFC to C#?

Performance is a big issue with our users, so we are very concerned about
keeping our application responsive for the users.


for most things it is very similar to C++ programs in my experience.
Most of the slowdown appears when you start the program. once the
program is running I don't think you'd notice much of a difference,
especially since it is a gui app and would be waiting on the user to do
something a majority of the time.

i think you'll be pleased with C# performance, especially C# 2.0. (3.0
by ECMA spec standard)

jeremiah
Dec 9 '05 #2
On Thu, 8 Dec 2005 17:21:55 -0600, "Bruce" <bw*****@nospam.nospam>
wrote:
So far, we have written a few pieces of our program in C# that get called
through a managed DLL. But they are used infrequently so the impact on
performance has been minimal. We wrote these pieces in C# because it was
easier to do in the short amount of time we had available. But our
experience with these components has been that the C# stuff tends to be much
more sluggish than the unmanaged MFC code in the rest of the application.


This is not representative of C# performance overall.

When you call into a managed DLL from unmanaged code, all calls must
be marshalled to compensate for the different storage of variables in
memory. Depending on your calls, data structures such as strings and
arrays will have to be copied back and forth.

That doesn't happen when you run a program entirely written in C#
(unless you extensively call back to native code, then you'll have the
same issues!). Pure C# is about 80% as fast as C++ in my experience.
--
http://www.kynosarges.de
Dec 9 '05 #3
Also, you definitely should be using version 2.0 of C# and the .NET
Framework. Generic collections are a huge help for big desktop apps,
both in terms of development and performance, and there are some nice
enhancements to Windows Forms that you wouldn't want to miss.
--
http://www.kynosarges.de
Dec 9 '05 #4
> Has anyone out there had experience writing or converting a large desktop
application from MFC to C#?

Performance is a big issue with our users, so we are very concerned about
keeping our application responsive for the users.

I am creating software that does image processing using using a mixture of
C# and managed+unmanaged C++.
Tests suggest that some functions will be faster others will be slower so it
is hard to predict the performance of the code.

One thing I would advice is to reduce jumping from managed to unmanaged and
the reverse as possible.
If you need some processing in a loop called form C# and uses functions in
unmanaged C++ then it is better to create a C++ class that performs this
loop, so this way no more transition speed loss.

Currently I am using C# for user interface, and unmanaged C++ for fast
processing.
C# because I can program much faster than the managed C++ code, and is far
more readable.

Tests here suggests about 5% speed loss average but I do develop my software
7 times faster, because it compiles much faster if I use C#.

One thing that might be important is that if you create pure C# code, then
you can flag it such a way that it runs as 64 bit on a 64 bit OS machine and
that same executable will run 32 bit on a 32 bit OS. Only one executable for
both platform!

There is a delay if you start up a program and when you start a function
that the has not been loaded before. This is because the code gets compiled
to native processor code, once it is loaded then it is running nearly as
fast as a normal C++ program. But this loading might give an impression that
C# programs are slower.

I hope this helps?


Dec 9 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
3
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification...
11
by: Grant Edwards | last post by:
I've read over and over that Python leaves floating point issues up to the underlying platform. This seems to be largely true, but not always. My underlying platform (IA32 Linux) correctly...
12
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now...
1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
5
by: Barry Anderberg | last post by:
I'm using a tool by Sci-Tech called the .NET Memory Profiler. We have a massive .NET/C# application here and it has been exhibiting memory leak behavior for some time. Attempting to remedy the...
5
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
29
by: Vol | last post by:
I think 'atan' can get the angle but it is not the four quadrant angle. Is there any function that i can get the angle from -pi to pi? or I have to use some if ... else? I know in Matlab, we use...
2
by: Nuno Magalhaes | last post by:
In pages that there is no content length, how does HttpWebResponse knows where the page ends? And what kind of objects/methods does it retrieve? Does it only retrieve the initial page without any...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.