473,587 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

moving to C# from VC++ 6 - how does app speed compare?

mt
Hi,

W H A T
I am considering moving my windows app written in Visual C++ 6.0 to C# .NET.
Q U E S T I O N
I was wondering if application speed will be a problem in .NET when compared
to a VC++6? Am I going to take a big performance hit?
W H Y
My main reason for doing this is to simplify the building of the app's front
end GUI. It seems that windows and controls construction is a WHOLE lot
easier in C# than it is with MFC? But I am totally new to .NET and C#, so I
may be wrong about this?
M Y A P P
My application is a single window SDI. It receives it's input via a network
ActiveX control, but it's just a string of characters really. It then does
some heavy string/character parsing, stores everything in arrays and then
prints text to the window. So the app's basic requiremts are :-

- parse strings of characters quickly
- store large numbers strings in memory efficiently and be able to get to
each string quickly
- repaint the interface when the user scrolls
- that's it :)

Thanks for any feedback.

Mike
Nov 15 '05 #1
4 1587
mt,

Doesn't sound as if your program uses a lot of MFC - so improvements in the
GUI design and implementation will be minimal.

What do you use for the string manipulations in the current design? Is it
STL, or the MFC CString class, or brute force using char * and CRT
functions?

If your app is highly tuned and you are using a mixture of these (STL for
storage, CString for display, and CRT functions for manipulations) then you
can expect to take a serious performance hit at first, partially due to the
learning curve, and partially due to the storage inefficiencies of the C#
string class.

That said, the performance delta may likely be unnoticeable by typical
users. For instance, your program may spend 10% of the wall clock time
manipulating and parsing strings, 55% of the time fetching data from the
network, and 35% of the time formatting, populating controls, and managing
the display.

After converting to C#, if you experience a 50% increase in the time to do
the manipulating and parsing, the precentages would be 14%, 52%, and 43%.

The things that C# does not do as well as native C/C++ programming are
typically not related to the "long pole in this tent"..

regards
roy fine

"mt" <th******@bells outh.net> wrote in message
news:3Y******** *********@bigne ws5.bellsouth.n et...
Hi,

W H A T
I am considering moving my windows app written in Visual C++ 6.0 to C# ..NET.

Q U E S T I O N
I was wondering if application speed will be a problem in .NET when compared to a VC++6? Am I going to take a big performance hit?
W H Y
My main reason for doing this is to simplify the building of the app's front end GUI. It seems that windows and controls construction is a WHOLE lot
easier in C# than it is with MFC? But I am totally new to .NET and C#, so I may be wrong about this?
M Y A P P
My application is a single window SDI. It receives it's input via a network ActiveX control, but it's just a string of characters really. It then does
some heavy string/character parsing, stores everything in arrays and then
prints text to the window. So the app's basic requiremts are :-

- parse strings of characters quickly
- store large numbers strings in memory efficiently and be able to get to
each string quickly
- repaint the interface when the user scrolls
- that's it :)

Thanks for any feedback.

Mike

Nov 15 '05 #2
inline:

"mt" <th******@bells outh.net> wrote in message
news:3Y******** *********@bigne ws5.bellsouth.n et...
Hi,

W H A T
I am considering moving my windows app written in Visual C++ 6.0 to C# ..NET.

Q U E S T I O N
I was wondering if application speed will be a problem in .NET when compared to a VC++6? Am I going to take a big performance hit?
That seriously depends on what the code is doing. Without more details (and
even with more details), the only way to tell may be to perf the two
versions.
W H Y
My main reason for doing this is to simplify the building of the app's front end GUI. It seems that windows and controls construction is a WHOLE lot
easier in C# than it is with MFC? But I am totally new to .NET and C#, so I may be wrong about this?
Depends I guess. I know somebody who coded in MFC for YEARS, and he's quite
comfortable with it. Took him a while to get his head wrapped around C# and
the Framework. You have the tendancy to look for things using the same
model, and get hung up when you have to solve the problem differently.
Personally, I hated using MFC, so I consider C# to be much easier myself (in
the area of building GUIs anyway). :-)
M Y A P P
My application is a single window SDI. It receives it's input via a network ActiveX control, but it's just a string of characters really. It then does
some heavy string/character parsing, stores everything in arrays and then
prints text to the window. So the app's basic requiremts are :-

- parse strings of characters quickly
- store large numbers strings in memory efficiently and be able to get to
each string quickly
- repaint the interface when the user scrolls
- that's it :)


So this is kind of like a network messaging thing? Hm, well, again this
going to depend. C#'s string manipulation might be a bit slower than using
brute force buffer manipulation in C. However, C# also supports pointers, so
it's possible you can work around some of these issues. On the other hand,
if the string manipulation is part of the scrolling window's job, there is
also the possibility of creating an ActiveX control using C++ and using it
on your C# SDI forms if you are really paranoid about speed. There are a lot
of variables and different ways to approach this. It's hard to say until you
try.

-Rob Teixeira [MVP]
Nov 15 '05 #3
mt
Roy,

Thanks for the feedback.

Mike
"Roy Fine" <rl****@twt.obf uscate.net> wrote in message
news:ey******** *******@TK2MSFT NGP10.phx.gbl.. .
mt,

Doesn't sound as if your program uses a lot of MFC - so improvements in the GUI design and implementation will be minimal.

What do you use for the string manipulations in the current design? Is it
STL, or the MFC CString class, or brute force using char * and CRT
functions?

If your app is highly tuned and you are using a mixture of these (STL for
storage, CString for display, and CRT functions for manipulations) then you can expect to take a serious performance hit at first, partially due to the learning curve, and partially due to the storage inefficiencies of the C#
string class.

That said, the performance delta may likely be unnoticeable by typical
users. For instance, your program may spend 10% of the wall clock time
manipulating and parsing strings, 55% of the time fetching data from the
network, and 35% of the time formatting, populating controls, and managing
the display.

After converting to C#, if you experience a 50% increase in the time to do
the manipulating and parsing, the precentages would be 14%, 52%, and 43%.

The things that C# does not do as well as native C/C++ programming are
typically not related to the "long pole in this tent"..

regards
roy fine

"mt" <th******@bells outh.net> wrote in message
news:3Y******** *********@bigne ws5.bellsouth.n et...
Hi,

W H A T
I am considering moving my windows app written in Visual C++ 6.0 to C# .NET.


Q U E S T I O N
I was wondering if application speed will be a problem in .NET when

compared
to a VC++6? Am I going to take a big performance hit?
W H Y
My main reason for doing this is to simplify the building of the app's

front
end GUI. It seems that windows and controls construction is a WHOLE lot
easier in C# than it is with MFC? But I am totally new to .NET and C#, so I
may be wrong about this?
M Y A P P
My application is a single window SDI. It receives it's input via a

network
ActiveX control, but it's just a string of characters really. It then

does some heavy string/character parsing, stores everything in arrays and then prints text to the window. So the app's basic requiremts are :-

- parse strings of characters quickly
- store large numbers strings in memory efficiently and be able to get to each string quickly
- repaint the interface when the user scrolls
- that's it :)

Thanks for any feedback.

Mike


Nov 15 '05 #4
Rob,

Thanks for the feedback.

I think that I will go the ActiveX route and turn my C++ code into a
control and have the C# do all the interface work.

I don't know how to build such an application (C# front end - C++
backend) so I guess I will search for some examples. If you have any
further pointers on this I would be glad to hear from you.

Thanks

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #5

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

Similar topics

4
2739
by: Naran Hirani | last post by:
Hi fellow Netters, I need to re-write a very old C/C++ application written in the days when MS/PC-DOS was king. The reason for the re-write is that the application needs some new functionality, but more crucially, some existing functionality does not seem to work on the current MS OSs. The application works with a bespoke electrical gadget which emits a
17
3278
by: PDQBach | last post by:
Hello, im a visual c++ und borland c++builder newbie. i have witten a simple mandelbrot algorithm and compiled it with both vc++ (mfc) and cbuilder (vcl) (same code besides the drawing part). the vc++ version is twice! as fast in release mode. in debug mode its as fast as cbuilder. it seems i cant get cbuilder to compile a real release version. when i check "Project options:compiler:release" it even gets slower than debug! i have played...
13
20592
by: MrCoder | last post by:
Hey guys, my first post on here so I'll just say "Hello everbody!" Ok heres my question for you lot. Is there a faster way to compare 1 byte array to another? This is my current code // Check for a match
1
1087
by: Jeff Magouirk | last post by:
Dear All, We have a procedure that takes12 minutes to run on the first server but that same procedure now takes 3 hours to run on the second server using the same data. Does anyone have any suggestions why this is happening and how to make the procedure faster on the second server Thanks in advance. Jeff Magouirk
8
2527
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined in global space, therefore it is not a global variable, yes? Even if it was global, how would it get from one function to another? In PHP variables are copied by value. Are they copied by reference in Javascript? <SCRIPT LANGUAGE="JavaScript">
1
943
by: steph | last post by:
Hi, I have a vc++6 project I migrated to vc++7 .NET. If I only migrate without using managed extension, link step takes 8 seconds. If I check "use manage extensions" in project properties, link step takes 4 minutes. I use incremental link. Why such a difference? Thanks steph
9
1951
by: borhan | last post by:
Hi folks, I am using vs.net 2003 for a time, however since last week I was using MFC. Now, I am into managed C++ and windows forms. I can say that I am very much confused with it, and I have some questions I hope I can find some answers here... 1. First of all, I got the answer to this question but I have to point that out! What kind of c++ programming is that to write all the
26
1941
by: _R | last post by:
Given that VS2005 has made an effort to clean up the syntax of VC++ (in C++/CLI), is there any future plans to do away with function protos, ala C#/VB? What are they needed for these days?
6
3864
by: Mart | last post by:
Hi, Is there a benchmark, or anything that could help me to compare the execution speed between VB.NET and VC++.NET ? I plan to developt a SCADA application but I don't need very fast reaction time such as x ms., 1 sec. would be enough. So I taught at first that I would need VC++.NET to make an ActiveX driver layer that the VB.NET application could use to get a connection
0
7854
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
8219
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
8349
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
8221
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
5722
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
5395
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
3845
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...
1
2364
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
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.