473,695 Members | 2,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2037
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+unmanag ed 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
4850
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 InternetExplorer But then I cant see when a user exit my objIExplorer and than an error will show up when I try to open a link in the IE window that does not exist... What can I do about this and way does it not work in win 98?
3
29676
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 says: "The 'visibility' property takes the value 'collapse' for row, row group, column, and column group elements. This value causes the entire row or column to be removed from the display, and the space normally taken up by the row or column to...
11
2157
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 handles 1.0/0.0 and 0.0/0.0 according to the IEEE 754 standard, but Python goes out of its way to do the wrong thing. 1/0 is defined by the standard as +Inf and 0/0 is NaN.
12
2941
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 sometimes Win 2000 Clients can't connect to the database. They connect over TCP/IP. The db2log says that the function getHostByName failed. It seems to be only on new installed win 2000 Workstations. Already installed WS have NOT this problem.
1
2787
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 c.ControlType = acTextBox then ...
5
2104
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 problems I am employing the aforementioned software in trying to track down the problems. After an hour or so of program execution, a snapshot of the managed heap shows 27,025 BinaryReader objects as having been garbage collected but never...
5
14028
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 VIS.DLL via Visual Studio, with no problems: ------ Rebuild All started: Project: VIS, Configuration: Debug .NET ------ Preparing resources... Updating references...
29
3356
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 'atan2( )' Also, is there any function to get the round value, similar with floor and ceil, such like: round(3.1) = 3 round(3.6) = 4
2
2383
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 images, i.e., does it only makes one "GET / HTTP/1.1\r\n\r\n"? Because I'm doing some projects on a webclient (to measure some statistic times) and the total bytes get byte HttpWebResponse are lower than the total objects I get via socket way. ...
89
6041
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 used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
0
8553
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8819
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6482
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5826
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.