Subject: Re: OOP All languages are practically equal!

From: "Anatoly Krasavin" <[email-masked]>
Date: Sun, 9 Jan 94 12:40:08 +0300

On Thu, 10 Feb 94 00:21:53 -0500, George Seibel wrote:

>Jerry Perlstein writes:
>
>I'm afraid Paul Townsend was right.  At least mostly right.  Dan's
>interpretation of Paul's statement was that dynamic allocation slowed
>the program significantly, like one second out of ten.  In a program
>like Amber, you could do the allocation one time, and that would be that.
>Never again would you need to allocate.  How long does one malloc() take?
>Some number of miliseconds, not a second on any machine I'm aware of.
>If your code is brain damaged, and does a malloc/free pair inside of an
>inner loop, then yes, you will slow down.  But that's not the fault of
>malloc, it's the fault of the programmer who doesn't design well.
>
>As for the speed of C relative to FORTRAN, my experience on SGI and Sun
>machines is that there is not a significant difference when both languages
>are used correctly.  I've done the comparison.  Fast loops in C look
>an awful lot like fast loops in FORTRAN.  You can write slow code in
>either language, too.
>
>George Seibel
>[email-masked]

I think there are no way dynamic memory allocation can slow down your 
program, because compiler works with both fixed and dynamically-allocated 
modules in the same way. Yes, if you write programs according to stupid 
Program Examples and allocate every float-point number in array, that it 
will be. But if you allocate only big modules (the whole matrix for 
example) then it works well.

What about benchmarks and compilers... Well, last versions of Fortran, C,
Pascal, etc work with numbers equally. All the remarks about "my program 
in Fortran works 30 percent quicker" show only that you haven't write 
optimal code. Anyway, if you like speed, then use build-in assembler to go 
through all bottle-necks. It is worth to spend a lot of time (10-100 times
at least!) to receive really optimal code (2-3 times) without any Fortran 
optimizers.

>
>
>---Administrivia: This message is automatically appended by the mail exploder:
>[email-masked] -- everyone     | [email-masked] -- coordinator
>[email-masked]: HELP CHEMISTRY  | Gopher: www.ccl.net (port 70 or 73)
>Anon. ftp www.ccl.net     | [email-masked] -- archive search
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Anatoly O. Krasavin
chief programmer
NMR group
N.D.Zelinsky Institute of Organic Chemistry
Leninsky pr, 47
117913, Moscow B-334
Russia
Fax (7-095) 135 53 28
Tel (7-095) 135 90 94
e-mail <[email-masked]>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-