From: Bum-Seok Hyun 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> NNTP-Posting-Host: davinci3.snu.ac.kr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk James Undery wrote: > In article <34FD3174 DOT 2401F904 AT gong DOT snu DOT ac DOT kr>, Bum-Seok Hyun > 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 THANKS !!! ------------------------------ Bum-Seok Hyun mailto:dominic AT gong DOT snu DOT ac DOT kr