Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Time and memory performance of C versus C++

Reply
Thread Tools

Time and memory performance of C versus C++

 
 
Duane Hebert
Guest
Posts: n/a
 
      11-10-2007

"red floyd" <> wrote in message
news:ZH5Zi.6702$ ...
> Malcolm McLean wrote:
>
>>>

>> Yes, but typically embedded processors do jobs which are utterly trivial.
>> Like turn on a few lights in a washing machine.
>>

>
> To quote Pauli.... This isn't right. It isn't even wrong.
>
> Lets see.... avionics, video codec, audio codec, other multimedia, printer
> engine....
>
> Yeah, those are just turning on a few lights.


Some of the lights are gigantic furnaces filled with
dnh3 and h2 at extremely high temperatures.


 
Reply With Quote
 
 
 
 
acehreli@gmail.com
Guest
Posts: n/a
 
      11-10-2007
On Nov 9, 12:48 pm, edie...@rcn.com wrote:
> On Nov 9, 2:48 pm, Ian Collins <ian-n...@hotmail.com> wrote:


> > One can write **** poor inefficient code in either language, or one can
> > write elegant efficient code in either. Programmers write code, not
> > compilers, so there isn't anything to study or discuss.


> These days with 3ghz computers with more than 1 gbyte RAM what is so
> important about elegant, efficient code?


Efficient code has more than one meaning:

1) If you mean fast program produced from that "efficient code," those
fast computers don't help at all with this simple problem: user
interfaces are not responsive. I click, nothing happens... I select a
pull-down menu, it is empty for a while. No matter how fast your
computer is.

2) If you mean code that is easy to maintain and alter, then I
completely disagree with you that fast computers can help. If there
are 14 files to modify to add one property to some component, then
your code is inefficient no matter what.

3) Some other meaning?

Ali

 
Reply With Quote
 
 
 
 
Ivar Rosquist
Guest
Posts: n/a
 
      11-10-2007
On Fri, 09 Nov 2007 15:03:41 -0800, red floyd wrote:

> Malcolm McLean wrote:
>
>
>> Yes, but typically embedded processors do jobs which are utterly
>> trivial. Like turn on a few lights in a washing machine.
>>
>>

> To quote Pauli.... This isn't right. It isn't even wrong.
>
> Lets see.... avionics, video codec, audio codec, other multimedia,
> printer engine....
>
> Yeah, those are just turning on a few lights.


Well, what can you expect from McLean, one who is so incompetent
that he does not know that he does not know?


 
Reply With Quote
 
James Kuyper
Guest
Posts: n/a
 
      11-10-2007
wrote:
....
>>>> edie...@rcn.com wrote:
>>>>> These days with 3ghz computers with more than 1 gbyte RAM what is so
>>>>> important about elegant, efficient code?

....
> Jeez, I just brought it up as a topic for discussion, didn't mean for
> anyone to get nasty


You're getting a nasty response because a lot of us have been victims of
programmers who felt exactly the same way you do. We use applications
that run too slow and take up too much memory, for no particularly good
reason, just because somebody thought there was no point to worrying
about efficiency. We update programs written by other people that are
maintenance nightmares because the original author thought that there
was no importance to writing code elegantly.
 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      11-10-2007
"Juha Nieminen" <> wrote in message
> wrote:
>> These days with 3ghz computers with more than 1 gbyte RAM what is so
>> important about elegant, efficient code?

>
> Ever played a modern computer game with millions of polygons per
> level, even tens of thousands of polygons visible at the same time,
> complex physics, etc? Do you want to play that kind of game at 0.5
> frames per second or at 30 frames per second in your 3GHz computer?
>

That rate-limiting step in such a game is probably the rasteriser rather
than the main processor.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm




 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      11-10-2007

"red floyd" <> wrote in message
news:ZH5Zi.6702$ ...
> Malcolm McLean wrote:
>
>>>

>> Yes, but typically embedded processors do jobs which are utterly trivial.
>> Like turn on a few lights in a washing machine.
>>

>
> To quote Pauli.... This isn't right. It isn't even wrong.
>
> Lets see.... avionics, video codec, audio codec, other multimedia, printer
> engine....
>
> Yeah, those are just turning on a few lights.
>

"Typically" means there will be a few counter-examples.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      11-10-2007
Malcolm McLean wrote, On 10/11/07 08:58:
>
> "red floyd" <> wrote in message
> news:ZH5Zi.6702$ ...
>> Malcolm McLean wrote:
>>
>>>>
>>> Yes, but typically embedded processors do jobs which are utterly
>>> trivial. Like turn on a few lights in a washing machine.
>>>

>>
>> To quote Pauli.... This isn't right. It isn't even wrong.
>>
>> Lets see.... avionics, video codec, audio codec, other multimedia,
>> printer engine....
>>
>> Yeah, those are just turning on a few lights.
>>

> "Typically" means there will be a few counter-examples.


Those "few counter-example" include within sight of me at least 7
embedded processors, the GPS I use in my car, and a minimum of one other
processor in my car. In fact, it will include at least one processor in
every DVD player, digital TV, DTV receiver, satalite decoder, cable TV
decoder, GPS, car and computer being sold as well as a lot of other kit.
Yes, computers *do* have embedded processors in them. I think you will
be hard pressed to find a household in the UK without a few of those
items. So this is NOT a small number of counter-examples, rather it is
several large industries.
--
Flash Gordon
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      11-10-2007
Malcolm McLean wrote:
>
> "red floyd" <> wrote in message
> news:ZH5Zi.6702$ ...
>> Malcolm McLean wrote:
>>
>>>>
>>> Yes, but typically embedded processors do jobs which are utterly
>>> trivial. Like turn on a few lights in a washing machine.
>>>

>>
>> To quote Pauli.... This isn't right. It isn't even wrong.
>>
>> Lets see.... avionics, video codec, audio codec, other multimedia,
>> printer engine....
>>
>> Yeah, those are just turning on a few lights.
>>

> "Typically" means there will be a few counter-examples.
>

I bet there's more cell phones shipped a year than washing machines.

--
Ian Collins.
 
Reply With Quote
 
lovecreatesbea...@gmail.com
Guest
Posts: n/a
 
      11-10-2007
On Nov 10, 3:17 am, Generic Usenet Account <use...@sta.samsung.com>
wrote:
> A lot of research has been done to prove that the contention that C
> code is more efficient and more compact than equivalent C++ code is a
> myth.


C++ is slower than C for the first one may call three functions:
cpp.constructor(), cpp.function() and cpp.destructor(). If it doesn't
call the constructor and destructor, it's C.

 
Reply With Quote
 
cr88192
Guest
Posts: n/a
 
      11-10-2007

"Malcolm McLean" <> wrote in message
news:...
> "Juha Nieminen" <> wrote in message
>> wrote:
>>> These days with 3ghz computers with more than 1 gbyte RAM what is so
>>> important about elegant, efficient code?

>>
>> Ever played a modern computer game with millions of polygons per
>> level, even tens of thousands of polygons visible at the same time,
>> complex physics, etc? Do you want to play that kind of game at 0.5
>> frames per second or at 30 frames per second in your 3GHz computer?
>>

> That rate-limiting step in such a game is probably the rasteriser rather
> than the main processor.
>


maybe if the game is heavily loaded with shaders...

but, at least for fairly basic rendering (no shaders, no stenciling, ...), I
suspect it is actually the case that a lot more often ends up going into
stuff going on in the main processor, than in the video card itself.

it may not seem like it, but the main engine has a hard time keeping up,
even when doing bunches of vertex-level calculations.

the speed of the graphics card should not be so easily discounted.

(of course, use shaders or enable stenciling, and the thing typically slows
way down...).


> --
> Free games and programming goodies.
> http://www.personal.leeds.ac.uk/~bgy1mm
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Mozilla versus IE versus Opera versus Safari Peter Potamus the Purple Hippo Firefox 0 05-08-2008 12:56 PM
equal? versus eql? versus == versus === verus <=> Paul Butcher Ruby 12 11-28-2007 06:06 AM
Time and memory performance of C versus C++ Generic Usenet Account C++ 68 11-26-2007 08:19 AM
Sony Memory Stick PRO versus regular Memory Stick (speed factor) eb7g Digital Photography 3 12-09-2004 11:51 PM
Web Form Performance Versus Single File Performance jm ASP .Net 1 12-12-2003 11:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57