RE: multidimensional arrays
RE: multidimensional arrays
- Subject: RE: multidimensional arrays
- From: Jeff Laing <email@hidden>
- Date: Wed, 16 Mar 2005 10:42:04 +1100
> While I agree to a certain extent, I have never seen a case where this
> kind of optimization can actually gain you anything significant other
> that when you have *massive* data sets.
Where "massive" is in the eye of the beholder and needs to take *time* into
account.
Whilst I agree in principle, I did encounter a problem a long time ago where
I was set some work by a lecturer to "code in assembler" because he was
convinced that his 2D FFT could never be made fast enough in C. I handed
him back a straight C version that was "too fast" - he had to concentrate on
speeding up other areas in his system to cope.
Unrolling array accesses when you know they are sequential and using
pointers to iterate along them, combined with actually paying attention to
the math you are actually doing in when processing your arrays pays off big
time even in small datasets if you have to visit them over and over.
ie there aren't many gains to be made made by recognising that an array
access could be converted to a pointer dereference - the gains come with
array iteration converted to pointer iteration.
Moral: understand your whole algorithm before you worry about tuning little
bits of it.
Which is just reiterating what others have said.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden