473,386 Members | 1,758 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,386 software developers and data experts.

memory requirement & .NET performance wonderment...

I just stumbled on a forum were people were saying they were porting old
native C++ app to winform/C#/.NET
and they experienced:
- drop in performance
- huge memory consumption.
Someone was saying this:
========
Recently I ported to C# a small transmatch cirquit design C++ application I
wrote a few years ago. The .NET port was more than 4x slower than native and
consumes up to 60MB of memory while native used no more than 5MB.
========

I found that hard to believe.
Although, honnestly, I cannot clain that I have done much real C++ work with
MFC or Win32. So I cannot realy compare objectively.
I just know that C# alway behaved well for what I need...

But anyway, I was wondering, could anyone share his experience on product
development with C# & C++ and compare the result.

Caution, I'm mainly interested in people having extensive experience in both
C++ & .NET. Not in newbied who says this new language (be it C# or C++)
sucks. But someone who has written a few real world program in both and
could compare with a wealth of performance/productivity
advice/ideas/feedback.

thanks ;-)
Oct 31 '05 #1
4 1394
Lloyd,

Although you ask only people with experience in that, do I think that you
have as well to tell experience in what kind of end product.

A huge database application will give probably totally different figures
than an application completely bound to the clients screen without any extra
data influence.

C++ builds a little bit larger empty exe than C#, while VBNet is the
smallest in that. However that says in my opinion absolutely nothing.

The managed code is build as Intermediate language. That processed by the in
the Net build in CLR. This with the exception from C++ that can be *as well*
used in the classic pre Net C++ way.

Maybe you think that this will cost time and memory. The opposite is often
true, mostly it creates more efficient code and is therefore quicker and
smaller (however not forever as I tried to show in the beginning)..

I hope this gives an idea.

Cor


"Lloyd Dupont" <net.galador@ld> schreef in bericht
news:OF**************@TK2MSFTNGP09.phx.gbl...
I just stumbled on a forum were people were saying they were porting old
native C++ app to winform/C#/.NET
and they experienced:
- drop in performance
- huge memory consumption.
Someone was saying this:
========
Recently I ported to C# a small transmatch cirquit design C++ application
I wrote a few years ago. The .NET port was more than 4x slower than native
and consumes up to 60MB of memory while native used no more than 5MB.
========

I found that hard to believe.
Although, honnestly, I cannot clain that I have done much real C++ work
with MFC or Win32. So I cannot realy compare objectively.
I just know that C# alway behaved well for what I need...

But anyway, I was wondering, could anyone share his experience on product
development with C# & C++ and compare the result.

Caution, I'm mainly interested in people having extensive experience in
both C++ & .NET. Not in newbied who says this new language (be it C# or
C++) sucks. But someone who has written a few real world program in both
and could compare with a wealth of performance/productivity
advice/ideas/feedback.

thanks ;-)

Oct 31 '05 #2
> Although you ask only people with experience in that, do I think that you
have as well to tell experience in what kind of end product.
Actually I'm porting a a MacOSX application which do heavy 2D graphics GDI+.
Basically it edit/display a MindMap "a document" (a bunch of related
shapes/text/image) a bit like, uh.. like Visio?
Heaps of Graphics.
Aside from GDI+ "slowness" (I haven't noticed anything) will I be better
doing that in pure C++?

Further later I intend to write (for fun) a mini-cad application to edit /
draw dungeon-house-terrain map.
Will C++ bring me anything?
In both case I doubt so but I will be curious to hear (convincing?) pro C++
only argument. I know for sure that the nice GUI interface would be
overwhingly difficult to write in MFC (the few times I tryed in the past I
never really manage to get it)

Also I was toying with the idea to write my port of the SQLite (engine) to
..NET. Not just for the sake of it but both to learn underlying technology
and add a few feature of my own which I found lacking in the current C
implementation.
And I'm curious as to know what performance drop (informed) people will
predict me.
The managed code is build as Intermediate language. That processed by the
in the Net build in CLR. This with the exception from C++ that can be *as
well* used in the classic pre Net C++ way.

Maybe you think that this will cost time and memory. The opposite is often
true, mostly it creates more efficient code and is therefore quicker and
smaller (however not forever as I tried to show in the beginning)..


I know ;-)
Oct 31 '05 #3
Hi Lloyd,

A .Net application incurs a certain amount of overhead from the platform it
runs on. Garbage Collection is an excellent way to avoid memory leaks, but
it also means that memory is not de-allocated as swiftly as in a traditional
C or C++ app. In addition, as C and C++ are basically the same language, and
a low-level language at that, any app written with C or C++ is going to
perform better than an app written using the .Net platform.

That said, the .Net platform has many methods of optimization built into it,
and a managed app can run quite fast. Specifically with regards to graphics,
I have found it necessary from time to time to use unsafe C code in my
managed applications, and when used appropriately, my apps run at a quite
acceptable pace, nearly as fast as a native C or C++ app.

I have also built apps using the Managed DirectX class libraries, and found
them to run at an excellent framerate. Again, the judicious use of unmanaged
code where appropriate is the key.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Lloyd Dupont" <net.galador@ld> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Although you ask only people with experience in that, do I think that you
have as well to tell experience in what kind of end product.

Actually I'm porting a a MacOSX application which do heavy 2D graphics
GDI+.
Basically it edit/display a MindMap "a document" (a bunch of related
shapes/text/image) a bit like, uh.. like Visio?
Heaps of Graphics.
Aside from GDI+ "slowness" (I haven't noticed anything) will I be better
doing that in pure C++?

Further later I intend to write (for fun) a mini-cad application to edit /
draw dungeon-house-terrain map.
Will C++ bring me anything?
In both case I doubt so but I will be curious to hear (convincing?) pro
C++ only argument. I know for sure that the nice GUI interface would be
overwhingly difficult to write in MFC (the few times I tryed in the past I
never really manage to get it)

Also I was toying with the idea to write my port of the SQLite (engine) to
.NET. Not just for the sake of it but both to learn underlying technology
and add a few feature of my own which I found lacking in the current C
implementation.
And I'm curious as to know what performance drop (informed) people will
predict me.
The managed code is build as Intermediate language. That processed by the
in the Net build in CLR. This with the exception from C++ that can be *as
well* used in the classic pre Net C++ way.

Maybe you think that this will cost time and memory. The opposite is
often true, mostly it creates more efficient code and is therefore
quicker and smaller (however not forever as I tried to show in the
beginning)..


I know ;-)

Oct 31 '05 #4
Mmhh... I see...
For what the 2 answers seems to confirm, while .NET use much more memory it
should provide very reasonable, if not almost similar performance.

Let's dismiss these warning reading of mine as rumor monger who didn't know
what they where talking about! ;-)

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Hi Lloyd,

A .Net application incurs a certain amount of overhead from the platform
it runs on. Garbage Collection is an excellent way to avoid memory leaks,
but it also means that memory is not de-allocated as swiftly as in a
traditional C or C++ app. In addition, as C and C++ are basically the same
language, and a low-level language at that, any app written with C or C++
is going to perform better than an app written using the .Net platform.

That said, the .Net platform has many methods of optimization built into
it, and a managed app can run quite fast. Specifically with regards to
graphics, I have found it necessary from time to time to use unsafe C code
in my managed applications, and when used appropriately, my apps run at a
quite acceptable pace, nearly as fast as a native C or C++ app.

I have also built apps using the Managed DirectX class libraries, and
found them to run at an excellent framerate. Again, the judicious use of
unmanaged code where appropriate is the key.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

"Lloyd Dupont" <net.galador@ld> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Although you ask only people with experience in that, do I think that
you have as well to tell experience in what kind of end product.

Actually I'm porting a a MacOSX application which do heavy 2D graphics
GDI+.
Basically it edit/display a MindMap "a document" (a bunch of related
shapes/text/image) a bit like, uh.. like Visio?
Heaps of Graphics.
Aside from GDI+ "slowness" (I haven't noticed anything) will I be better
doing that in pure C++?

Further later I intend to write (for fun) a mini-cad application to edit
/ draw dungeon-house-terrain map.
Will C++ bring me anything?
In both case I doubt so but I will be curious to hear (convincing?) pro
C++ only argument. I know for sure that the nice GUI interface would be
overwhingly difficult to write in MFC (the few times I tryed in the past
I never really manage to get it)

Also I was toying with the idea to write my port of the SQLite (engine)
to .NET. Not just for the sake of it but both to learn underlying
technology and add a few feature of my own which I found lacking in the
current C implementation.
And I'm curious as to know what performance drop (informed) people will
predict me.
The managed code is build as Intermediate language. That processed by
the in the Net build in CLR. This with the exception from C++ that can
be *as well* used in the classic pre Net C++ way.

Maybe you think that this will cost time and memory. The opposite is
often true, mostly it creates more efficient code and is therefore
quicker and smaller (however not forever as I tried to show in the
beginning)..


I know ;-)


Oct 31 '05 #5

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

Similar topics

13
by: sachin_mzn | last post by:
Hi, What is the concept of memory alignment? Is memory alignment differs, If a data type is local to a function or if it is a member of structure or union? How 32 to 64 bit processor afftects the...
1
by: Teemu Keiski | last post by:
Hi, I have following type of scenario (also explained here http://blogs.aspadvice.com/joteke/archive/2005/01/10/2196.aspx ) We have problematic web server (wink2 Standard, 1.5GB of physical...
4
by: Lloyd Dupont | last post by:
I just stumbled on a forum were people were saying they were porting old native C++ app to winform/C#/.NET and they experienced: - drop in performance - huge memory consumption. Someone was...
4
by: Alexandre Brisebois (www.pointnetsolutions.com) | last post by:
Hi, I am currently building a lexical analysis component to pull keywords out of content, I currently have a functional first build, but I am having problems ince I am easily loading over 300...
66
by: Johan Tibell | last post by:
I've written a piece of code that uses sockets a lot (I know that sockets aren't portable C, this is not a question about sockets per se). Much of my code ended up looking like this: if...
49
by: vfunc | last post by:
If I have a large array 10,000+ elements then how do I reserve memory for this ? Currently I get a segmentation fault. Dynamic reservation is good, but allowing a chunk for the program is an...
17
by: christophe.chazeau | last post by:
Hi, I have a problem with a really simple chunk of code which should work but does obviously does not. This chunk of code is just a POC aimed at finding a bug in a larger project in which the...
13
by: Chris Thomasson | last post by:
Here is some info on a C++ allocator prototype I am working on: http://groups.google.com/group/comp.lang.c++/browse_frm/thread/beeee1f61fdbb52c Any tried-and-true techniques for calculating the...
5
by: tombrogan3 | last post by:
Hi, I need to implement in-memory zlib compression in c# to replace an old c++ app. Pre-requisites.. 1) The performance must be FAST (with source memory sizes from a few k to a meg). 2) The...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
0
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,...
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,...

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.