Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Time and memory performance of C versus C++ (http://www.velocityreviews.com/forums/t550612-time-and-memory-performance-of-c-versus-c.html)

Generic Usenet Account 11-09-2007 07:17 PM

Time and memory performance of C versus C++
 
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. My posting pertains to a slightly different aspect of this
debate. Here are my two questions:

1) Does anyone have any information on comparison of C and C++
software written for the ARM processor?

2) Are there any compiler and CPU dependencies that have to be
factored in while debating this issue? Or, is the issue more or less
settled for all compilers and all CPUs?

Thanks,
Kandregula Anil K.


Victor Bazarov 11-09-2007 07:32 PM

Re: Time and memory performance of C versus C++
 
Generic Usenet Account 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.


I'll take your word for it.

> My posting pertains to a slightly different aspect of this
> debate. Here are my two questions:
>
> 1) Does anyone have any information on comparison of C and C++
> software written for the ARM processor?
>
> 2) Are there any compiler and CPU dependencies that have to be
> factored in while debating this issue?


No. There is no point in debating this "issue" whatsoever. I am
sure that among my brethren in 'comp.lang.c' there will be somebody
with a different opinion, of course.

> Or, is the issue more or less
> settled for all compilers and all CPUs?


http://www.research.att.com/~bs/bs_faq.html#C-is-better Do you see
any mention of a platform or CPU?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask



Ian Collins 11-09-2007 07:48 PM

Re: Time and memory performance of C versus C++
 
Generic Usenet Account 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. My posting pertains to a slightly different aspect of this
> debate. Here are my two questions:
>
> 1) Does anyone have any information on comparison of C and C++
> software written for the ARM processor?
>

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.

--
Ian Collins.

ediebur@rcn.com 11-09-2007 08:48 PM

Re: Time and memory performance of C versus C++
 
On Nov 9, 2:48 pm, Ian Collins <ian-n...@hotmail.com> wrote:
> Generic Usenet Account 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. My posting pertains to a slightly different aspect of this
> > debate. Here are my two questions:

>
> > 1) Does anyone have any information on comparison of C and C++
> > software written for the ARM processor?

>
> 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.
>
> --
> Ian Collins.


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



jameskuyper@verizon.net 11-09-2007 09:02 PM

Re: Time and memory performance of C versus C++
 
edie...@rcn.com wrote:
....
> These days with 3ghz computers with more than 1 gbyte RAM what is so
> important about elegant, efficient code?


As our computers get more powerful, the problems we try to solve with
them get more difficult. If you have a program which takes 10 days to
run on a 3-GHz machine with 1GB RAM, an algorithm change that causes a
speed-up by a factor of 2 is going to look pretty sweet.

Truly elegant code is easier to understand and maintain; with
programmer time costing so much more than CPU time, elegance is
getting steadily more important, not less.


Tor Rustad 11-09-2007 09:03 PM

Re: Time and memory performance of C versus C++ [TROLL ALERT]
 
Generic Usenet Account 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. My posting pertains to a slightly different aspect of this
> debate. Here are my two questions:
>
> 1) Does anyone have any information on comparison of C and C++
> software written for the ARM processor?


Platform or C++ specific questions, are off-topic in c.l.c

> 2) Are there any compiler and CPU dependencies that have to be
> factored in while debating this issue? Or, is the issue more or less
> settled for all compilers and all CPUs?


Compiler or CPU specific questions, are off-topic in c.l.c


--
Tor <bwzcab@wvtqvm.vw | tr i-za-h a-z>

jacob navia 11-09-2007 09:06 PM

Re: Time and memory performance of C versus C++
 
ediebur@rcn.com wrote:
> On Nov 9, 2:48 pm, Ian Collins <ian-n...@hotmail.com> wrote:
>> Generic Usenet Account 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. My posting pertains to a slightly different aspect of this
>>> debate. Here are my two questions:
>>> 1) Does anyone have any information on comparison of C and C++
>>> software written for the ARM processor?

>> 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.
>>
>> --
>> Ian Collins.

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


This is the attitude that leads to shitty and bloated programs.

Since shitty programs are the way to go (they cost less effort
to write, they lead to the user buying a new machine, they make the
economy go round) you are right of course.

Let's write the new computer language: C# running in a virtual
machine written in GWBASIC.



--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32

Stephen Sprunk 11-09-2007 09:10 PM

Re: Time and memory performance of C versus C++
 
"Generic Usenet Account" <usenet@sta.samsung.com> wrote in message
news:1194635845.241670.69590@y27g2000pre.googlegro ups.com...
> 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.


Of course it's a myth. If you write equivalent code, the performance will
be nearly identical, since AFAIK all interesting compilers share the code
generation engine across both C and C++ modes.

OTOH, C++ allows you to write a different style of code that can't (easily
or efficiently) be written in C. C++'s additional features to support that
style also tend to be the features that are either particularly slow to
execute or encourage programmers to write slow code -- but they also tend to
make the code code faster to write and easier to understand and debug.
Depending on the purpose and use of the code, that may or may not be a smart
trade-off.

(Specifically, templates and classes can save massive amounts of programmer
time -- but they also hide from the programmer what's going on under the
hood so that he/she may not realize that a simple-looking statement may be
hundreds of times more complex than a slightly more-complex-looking
statement.)

> My posting pertains to a slightly different aspect of this debate.
> Here are my two questions:
>
> 1) Does anyone have any information on comparison of C and C++
> software written for the ARM processor?


The processor type has nothing to do with it.

> 2) Are there any compiler and CPU dependencies that have to be
> factored in while debating this issue? Or, is the issue more or less
> settled for all compilers and all CPUs?


The latter, at least in the sense it's "settled" that your question is
either nonsensical or irrelevant.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking


--
Posted via a free Usenet account from http://www.teranews.com


Ian Collins 11-09-2007 09:10 PM

Re: Time and memory performance of C versus C++
 
ediebur@rcn.com wrote:
> On Nov 9, 2:48 pm, Ian Collins <ian-n...@hotmail.com> wrote:
>> Generic Usenet Account 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. My posting pertains to a slightly different aspect of this
>>> debate. Here are my two questions:
>>> 1) Does anyone have any information on comparison of C and C++
>>> software written for the ARM processor?

>> 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.
>>

*Please* don't quote signatures
>
> These days with 3ghz computers with more than 1 gbyte RAM what is so
> important about elegant, efficient code?
>

Do you have any pride in your work?

--
Ian Collins.

moschops 11-09-2007 09:15 PM

Re: Time and memory performance of C versus C++
 
ediebur@rcn.com wrote:

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



Hey, that's great! Where can I pick up one of these 3ghz 1GB RAM
computers? I need it to be about 3 cm by 3 cm all in, drawing no more
than one amp of current and using about 10W of power, with a JTAG port
on board.

What's that, you say? There's no such thing? Well then, I guess I'll
have to use whatever I can get in that size, current and power
limitations and just do some damned elegant coding to get it to do what
I need.

Lift your head from the keyboard once in a while, chum. There's more to
computing that desktop PCs.

'Chops


All times are GMT. The time now is 12:18 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.