🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.image.processing
Article #330

Re: image processing loops: a c programming question

#330
From: Fuzzy Fox
Date: Wed, 12 Aug 1992 18:15
20 lines
1240 bytes
slehar@kendall.bu.edu (Steve Lehar) writes:

>This works o.k,  but  the problem now is  that   you are performing  a
>multiplication  in  the innermost  loop  of the  program,  which slows
>things down quite a bit.

I hope you are aware that that when you create an array, say, int
array[200][200], then when you reference array[i][j], there is an
implicit multiplication performed by the compiler to find this address.
There is no performance loss or gain by doing the multiplication
explicitly when you malloc your own array.

The solution given previously, using an array of pointers, is probably
the best speed-up.

-- 
#ifdef TRUE         | Fuzzy Fox                  fuzzy@netcom.com
#define  TRUE   0   | a.k.a. David DeSimone      an207@cleveland.freenet.edu
#define  FALSE  1   |
#endif              |         How's my posting?  Call 1-800-ALT-FLAME
Technical Details
Message-ID: <1992Aug12.181548.2656@rei2.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!rei2!fox
References: <SLEHAR.92Aug7111245@kendall.bu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: sci.image.processing
Path: arc1-ca.pugleaf.net!sparky!uunet!rei2!fox
From: fox@rei2.uucp (Fuzzy Fox)
Subject: Re: image processing loops: a c programming question
Message-ID: <1992Aug12.181548.2656@rei2.uucp>
Date: Wed, 12 Aug 1992 18:15:48 GMT
Distribution: sci.image.processing
References: <SLEHAR.92Aug7111245@kendall.bu.edu>
Organization: REI
Lines: 20