473,668 Members | 2,654 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 2034
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
4846
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
29675
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
2154
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
2938
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
2784
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
2098
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
14020
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
3354
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
6035
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
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8797
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...
0
8656
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6209
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
5681
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
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1786
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.