Message-ID: <34FF5336.58CB4E37@pacificnet.net> Date: Thu, 05 Mar 1998 17:36:55 -0800 From: Ralph Gesler MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: [Q]Computing speed in C++ References: <34FCB769 DOT 42BEF1A8 AT gong DOT snu DOT ac DOT kr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Bum-Seok Hyun wrote: > Hi!!! > > I'm not sure that I can write this newsgroup on my problem, > but I guess somebody can help me. > > I'm using DJGPP as C++ compiler on my pc. > My research area is CFD and I have done much work > using Fortran 77. > > I can't say I hate Fortran, but I feel like moving to > more flexible language. > > So I made a test for comparing computing time. > The result is > c code : 21 sec > c++ code : 57 sec > Fortran77 code : 115 sec > > The test code is quite simple, consisted of 3 nested "for" loops. > > I don't understand this situation. > > I've read manuals and they told me > computing time should be at least close between C and C++ > > Does this mean that C++(or DJGPP) is not suitable > for numerical computation? > > Thanks in advance > > Bum-Seok Hyun This whole thread is only a demonstration of the performance penalties that can be suffered as a result of poor coding praciticies. Don't reinvent the wheel a billion times just because the rules say you can. Ralph Gesler