Click here to Skip to main content
15,903,175 members
Home / Discussions / C#
   

C#

 
Questionc++/C# Performance Question Pin
Tom Thorp27-Jun-07 0:32
Tom Thorp27-Jun-07 0:32 
AnswerRe: c++/C# Performance Question Pin
Christian Graus27-Jun-07 0:38
protectorChristian Graus27-Jun-07 0:38 
GeneralRe: c++/C# Performance Question Pin
Tom Thorp27-Jun-07 1:14
Tom Thorp27-Jun-07 1:14 
GeneralRe: c++/C# Performance Question Pin
Martin#27-Jun-07 1:22
Martin#27-Jun-07 1:22 
GeneralRe: c++/C# Performance Question Pin
Christian Graus27-Jun-07 1:36
protectorChristian Graus27-Jun-07 1:36 
GeneralRe: c++/C# Performance Question Pin
Dan Neely27-Jun-07 2:08
Dan Neely27-Jun-07 2:08 
GeneralRe: c++/C# Performance Question Pin
leppie27-Jun-07 2:02
leppie27-Jun-07 2:02 
AnswerRe: c++/C# Performance Question Pin
Luc Pattyn27-Jun-07 8:48
sitebuilderLuc Pattyn27-Jun-07 8:48 
Hi Tom,

I understand your doubts; we had the same doubts more than ten years ago, when
we considered switching embedded system programming to Java; Java has a similar
garbage collection approach. But we did switch over, and soon we were glad we did
because of the increased programmer efficiency and code robustness.

The garbage collection concept is quite OK if you pay some attention to it.

Of course you must (continue to) care about the number of objects you create; every object
sooner or later must be retrieved to recycle the memory it was occupying.
Switching an image processing application from C++ to C# should not be seen as an
open invitation to turn every pixel into an object...

Here are some examples that limit the object generation rate:

1. when performing complex string operations (say a number of concatenations),
you will be better of using a StringBuilder.

2. short-lived objects, large or small, that only consume a limited number of CPU
cycles in their life span, need special attention, to avoid the gc effort becoming
noticeable. If you currently manage these objects yourself,
you can continue to do this, by recycling them, rather than letting them fade away.
I do not recommend you do this all the time, but when applied to a few classes at
the heart of your application domain, it may prove quite useful.

Of course these examples may seem like giving in on the advantages of C#, but that
would be true only partially and locally. It is similar to general performance optimisation:
in order to improve overall app performance, one must look for hot spots and then give in
a bit to gain some (or a lot).

Hope this may be helpful.

Smile | :)


Questionserial port + data receiving event Pin
DKalepu27-Jun-07 0:13
DKalepu27-Jun-07 0:13 
AnswerRe: serial port + data receiving event Pin
Mir_As27-Jun-07 0:23
Mir_As27-Jun-07 0:23 
GeneralRe: serial port + data receiving event Pin
Mir_As27-Jun-07 0:30
Mir_As27-Jun-07 0:30 
GeneralRe: serial port + data receiving event [modified] Pin
DKalepu27-Jun-07 0:57
DKalepu27-Jun-07 0:57 
GeneralRe: serial port + data receiving event Pin
kristmun27-Jun-07 1:27
kristmun27-Jun-07 1:27 
GeneralRe: serial port + data receiving event Pin
Luc Pattyn27-Jun-07 9:13
sitebuilderLuc Pattyn27-Jun-07 9:13 
GeneralPlease, everybody watching this thread, cause it's very urgent, and homework!!!! Pin
Martin#27-Jun-07 0:15
Martin#27-Jun-07 0:15 
GeneralRe: Please, everybody watching this thread, cause it's very urgent, and homework!!!! Pin
Tamimi - Code27-Jun-07 1:05
Tamimi - Code27-Jun-07 1:05 
GeneralRe: Please, everybody watching this thread, cause it's very urgent, and homework!!!! Pin
Martin#27-Jun-07 1:12
Martin#27-Jun-07 1:12 
GeneralRe: Please, everybody watching this thread, cause it's very urgent, and homework!!!! Pin
Tamimi - Code27-Jun-07 1:38
Tamimi - Code27-Jun-07 1:38 
QuestionTypes of containers [modified] Pin
srujana_m27-Jun-07 0:05
srujana_m27-Jun-07 0:05 
AnswerRe: Types of containers Pin
giddy_guitarist27-Jun-07 9:24
giddy_guitarist27-Jun-07 9:24 
Questionserialport and dangerous blue sreen? Pin
Mir_As27-Jun-07 0:02
Mir_As27-Jun-07 0:02 
Questioncrystal report Pin
B.A27-Jun-07 0:00
B.A27-Jun-07 0:00 
QuestionHow to create a DLL Library using C# called by the C/COBOL ? Pin
kuen65626-Jun-07 22:55
kuen65626-Jun-07 22:55 
QuestionDouble Buffered problem Pin
Richard W Allen26-Jun-07 22:29
Richard W Allen26-Jun-07 22:29 
AnswerRe: Double Buffered problem Pin
Eduard Keilholz26-Jun-07 23:22
Eduard Keilholz26-Jun-07 23:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.