delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/04/10:30:52

From: Bum-Seok Hyun <dominic AT gong DOT snu DOT ac DOT kr>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: [Q]Computing speed in C++
Date: Wed, 04 Mar 1998 22:38:02 +0900
Organization: Seoul National University, Republic of Korea
Lines: 37
Message-ID: <34FD593A.DF2207FA@gong.snu.ac.kr>
References: <34FCB769 DOT 42BEF1A8 AT gong DOT snu DOT ac DOT kr>
<34FD3174 DOT 2401F904 AT gong DOT snu DOT ac DOT kr> <NhY3fDAorU$0Ewz4 AT ghoti DOT demon DOT co DOT uk>
NNTP-Posting-Host: davinci3.snu.ac.kr
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

James Undery wrote:

> In article <34FD3174 DOT 2401F904 AT gong DOT snu DOT ac DOT kr>, Bum-Seok Hyun
> <dominic AT gong DOT snu DOT ac DOT kr> writes
> >In C code, I just moved variable definitions
> >into the first line of the code.
>
> Why, a fairer comparison of C and C++ is to compile the C as C++
>

I did what you told me to.
But the gap of computing time between C and C++
still remained almost the same.

> >I don't think that makes musch difference between C++ and C.
>
> Yes it does, or certainly would do with objects. 'j' would be
> constructed (and destructed) 10000 times and 'k' 100000 times.

If the variables, i,j,k are objects, you could be right.

> That said the C++ is still slower 22s (25s using your code) compared to
> 16s (on my system).
> --

Excuse me, sir.Exactly what did mean using my code and yours?

> James Undery <james AT ghoti DOT demon DOT co DOT uk>

THANKS !!!

------------------------------
Bum-Seok Hyun

mailto:dominic AT gong DOT snu DOT ac DOT kr


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019