From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public From: srt@nospam.csci.unt.edu (Steve Tate) Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/13 Message-ID: <61tq8p$t61@hermes.acs.unt.edu>#1/1 X-Deja-AN: 280164299 Distribution: world References: <61g30t$o2n@news-rocq.inria.fr> <61ho3v$3m0$1@goanna.cs.rmit.edu.au> <343CE2F4.362D80F0@tonys.ecology.umn.edu> <61k9g2$2fa@mulga.cs.mu.OZ.AU> <34406444.A9D6EF97@tonys.ecology.umn.edu> Followup-To: comp.sys.intel,comp.arch,comp.sys.dec Organization: University of North Texas Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec boo (boo@tonys.ecology.umn.edu) wrote: > Tyson Richard DOWD babbled: > > >I really cannot fathom why you actually > > >believe that this is more low level. As far as I understood, > > >computer memory is not two dimensional, and so I would rather > > > > If I told you computer memory was two dimensional, would you do things > > differently? I don't understand this line of reasoning. > Because eventually, someone or something is going to have > to map the dimensionality of your "arrays" to the dimensionality > of the computer memory. I don't expect you to understand this, > though, so why don't you just let your Fortran compiler do > the thinking for you. Your original comment was that "as far as I understood, computer memory is not two dimensional", and then you go off on this latest posting and talk about how you're interested in computers that are used by many people. Well the computers that are used by millions of people DO have two dimensional memory, which you seem unaware of. DRAM (of any kind) is two dimensional: locations have a row address and a column address. This is hidden, for the most part, by other hardware, but it really is there and it really can make a performance difference. Not that this relates directly to the current language war... The whole thread here of FORTRAN vs. C is a common religious war, but let me throw in my 2 cents and risk being called a "crap C programmer" by people (which would definitely not be true, incidentally). A while back (this is probably 5 or 6 years ago) I was trying to get as fast an FFT as possible, so I was experimenting with split-radix FFT. Being a C programmer first, I implemented this in C and spent quite a bit of time getting everything as efficient as possible. When I was done I decided, on a lark, to implement the same general algorithm in a very straight-forward fashion using FORTRAN. I spent a couple of days timing and tuning the C code, and about an hour on the FORTRAN code. And the FORTRAN code was probably 5% FASTER. That surprised me quite a bit. Now it could very well be that I was using gcc as a C compiler, which isn't the greatest compiler in the world, and I was using a propriety very optimized FORTRAN compiler. So maybe a better C compiler would give me that 5% of runtime speed back. But what would give me that 2 days of C tuning time back? Bottom line is this. People arguing that "C is always better" are being silly. People arguing that "FORTRAN is always better" are being silly. Each has its place. If I were writing straight numerical code with very nice predictable access patterns, I'd use FORTRAN and have the compiler optimize the hell out of it. If I were doing a non-numerical problem and had to implement some advanced linked data structure (for example, an AVL tree or a skip list), I'd use C. Don't delude yourself into thinking everything looks like a nail just because you want to use your hammer all the time (a mangling of a popular cliche there, but what the hell...). -- Steve Tate --- srt@cs.unt.edu | "As often as a study is cultivated by narrow Dept. of Computer Sciences | minds, they will draw from it narrow University of North Texas | conclusions." -- John Stuart Mill, 1865. Denton, TX 76201 |