473,473 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create 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 1574
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******@bellsouth.net> wrote in message
news:3Y*****************@bignews5.bellsouth.net...
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******@bellsouth.net> wrote in message
news:3Y*****************@bignews5.bellsouth.net...
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.obfuscate.net> wrote in message
news:ey***************@TK2MSFTNGP10.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******@bellsouth.net> wrote in message
news:3Y*****************@bignews5.bellsouth.net...
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
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,...
17
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)....
13
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 //...
1
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...
8
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...
1
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...
9
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...
26
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
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...
0
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...
0
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,...
0
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...
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.