Any tips/hints regarding moving through an array. 
Author Message
 Any tips/hints regarding moving through an array.

Hi,

I've got a program that loops through X/Y co-ords, does some calculations,
stores the results in a tiny array (16 elements), then finds the largest
value in the tiny array, stores this info to a array representing the X/Y
co-ords, then moves onto the next co-ord.

At the moment it take some time to process and I would love to speed it up.
Are there any pointers I should be aware off?
i.e. what slows down loops, what speeds up loops. I'm also using a loop to
find the largest value in the small 16 element array, is there a more
efficient method?

Thanks for any advice.

Stuart



Sat, 31 Jan 2004 20:50:29 GMT  
 Any tips/hints regarding moving through an array.
Post your code.

Mike


Quote:
> Hi,

> I've got a program that loops through X/Y co-ords, does some calculations,
> stores the results in a tiny array (16 elements), then finds the largest
> value in the tiny array, stores this info to a array representing the X/Y
> co-ords, then moves onto the next co-ord.

> At the moment it take some time to process and I would love to speed it
up.
> Are there any pointers I should be aware off?
> i.e. what slows down loops, what speeds up loops. I'm also using a loop to
> find the largest value in the small 16 element array, is there a more
> efficient method?

> Thanks for any advice.

> Stuart



Sat, 31 Jan 2004 21:00:46 GMT  
 Any tips/hints regarding moving through an array.
Your code is populating the array, then looping thru it to find the highest
value?  Without seeing your code, one idea is to keep track of the highest
value you've added so far when you ADD the values to the array.  That way you
won't have to loop thru it after you finish populating it.

Lee Weiner
lee DOT weiner AT home DOT com
http://members.home.net/lee.weiner


Quote:

>Hi,

>I've got a program that loops through X/Y co-ords, does some calculations,
>stores the results in a tiny array (16 elements), then finds the largest
>value in the tiny array, stores this info to a array representing the X/Y
>co-ords, then moves onto the next co-ord.

>At the moment it take some time to process and I would love to speed it up.
>Are there any pointers I should be aware off?
>i.e. what slows down loops, what speeds up loops. I'm also using a loop to
>find the largest value in the small 16 element array, is there a more
>efficient method?

>Thanks for any advice.

>Stuart



Sun, 01 Feb 2004 05:54:45 GMT  
 Any tips/hints regarding moving through an array.

Quote:

> Hi,

> I've got a program that loops through X/Y co-ords, does some calculations,
> stores the results in a tiny array (16 elements), then finds the largest
> value in the tiny array, stores this info to a array representing the X/Y
> co-ords, then moves onto the next co-ord.

> At the moment it take some time to process and I would love to speed it up.
> Are there any pointers I should be aware off?
> i.e. what slows down loops, what speeds up loops. I'm also using a loop to
> find the largest value in the small 16 element array, is there a more
> efficient method?

> Thanks for any advice.

> Stuart

W/O seeing your code, in addition to the already provided point to save
the largest quantity as you compute it, make sure you process any 2D
arrays in major order...this can make significant processing
difference.  Beyond these I think seeing code will be req'd to help
much.

Another, more painful alternative is to write the processing in another
language such as C or fortran and call it from VB as a DLL



Sun, 01 Feb 2004 08:31:51 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. need hints regarding access to thedatabase on the WebPage

2. Hints And Tips For New Posters In The Access Newsgroups

3. INFO [Very Rough Draft] Hints and tips on creating Add-Ins

4. Hints/tips for vector-based graphics in VB5

5. HINt / tIP / instant help funtionality ??

6. Hints, Tips or Articles on Designing and Coding Public Object Models

7. Hints, Tips or Articles on Designing and Coding Public Object Models

8. Hints, Tips or Articles on Designing and Coding Public Object Models

9. Question regarding an array and a series of listboxes on a form

10. Question regarding Layered Panels using ctrl arrays

11. Questions regarding arrays

12. Question regarding arrays, loops and combo boxes

 

 
Powered by phpBB® Forum Software