| shenadcuue | Date: Saturday, 22 Jun 2013, 00:07:28 | Message # 1 |
|
Colonel
Group: Users
Messages: 241
Status: Offline
| <a href=http://www.raybanswayfarer-au.com/new-rare-print-ray-ban-rb81040-black-patterngrey-lens-sales-2312-cheap-and-fashion-p-206.html>New Rare Print Ray Ban RB81040 Black Pattern--Grey Lens Sales 2312 (Cheap And Fashion)</a> <a href=http://www.raybanswayfarer-au.com/cheap-cats-ray-ban-rb4125-black-frames-grey-lenses-sales-2193-online-a-perfect-choice-p-94.html>Cheap Cats Ray Ban RB4125 Black Frames Grey Lenses Sales 2193 Online (A Perfect Choice)</a> <a href=http://www.raybanswayfarer-au.com/ray-ban-new-rare-print-rb25093-deep-brown-purple-pattern-frames-tawny-lenses-sales-2289-wholesale-popular-p-207.html>Ray Ban New Rare Print RB25093 Deep Brown Purple Pattern Frames Tawny Lenses Sales 2289 Wholesale Popular</a>
Another point, compare the theoretical peak performance of your processor (integer operations) with the performance you're getting (do a quick count of the assembly generated instructions, multiply by the length of the input, etc.) and see if there's room for a significant improvement there. Multidimesional arrays often constrain the compiler to one or more multiply operations. It may be slow on some CPUs. A common workaround is to transform the Ndimensional array into an array of pointers to elements of (N1) dimensions. With a 4dim. array is quite annoying (26 pointers to 2626 pointers to 262626 rows.) I suggest to try it and compare the result. It is not guaranteed that it's faster: compilers are quite smart in optimizing array accesses, while a chain of indirect accesses has higher probability to invalidate the cache. Remember that C/C++ arrays are stored in rowmajor order. Remember to store your data so that addresses referenced closely in time reside closely in memory. For example, it may make sense to store subresults in a temporary array. Then you could process exactly one row of elements located sequentially. That way the processor cache will always contain the row during iterations and less memory operations will be required. However, you might need to modularize your lookup_array function. Maybe even split it into four (by the number of dimensions in your array). 锘? dimensional array lookup in C The problem is definitely related to the size of the matrix. You cannot optimize it by declaring as a single array just because it's what the compiler does automatically.
http://oakleysunglasses2uk.webs.com/
|
| |
|
|