[thelist] Digital Cameras revisited, and a tip
Scott Dexter
sgd at ti3.com
Thu Dec 28 12:18:26 CST 2000
Well, if you guys remember, I was shopping for a digital camera back at the
end of November. The consensus concluded on something like the Olympus
D340L. I had my heart set on that exact camera, and happened to mention it
(in passing) to Santy Claus .... Santy brought an Olympus D490. Needless to
say I love it!
<tip type="simple optimization">
trim your loops down to the nitty gritty. Don't do *any* operation inside a
loop that you don't have to. Overly simple example with a catch
(pseudocode):
Before
------
for i=0 to 100
pig = formvalue(pig)
pigcounter = pig + i
next
After
------
pig = formvalue(pig)
for i=0 to 100
pigcounter = pig + i
next
--Now I know some of you may be thinking this:
for i=0 to 100
pigcounter = formvalue(pig) + i
next
will be an acceptable optimized loop; however, accessing the formvalue value
a hundred times is expensive (slower) compared to setting it to a temp
variable.
</tip>
sgd
--
work: http://www.ti3.com/
non: http://thinksafely.org/
More information about the thelist
mailing list