comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How to speed up large FOR loops?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How to speed up large FOR loops? [message #79814] Tue, 10 April 2012 08:48 Go to previous message
Saurav Dhital is currently offline  Saurav Dhital
Messages: 4
Registered: April 2012
Junior Member
Hi,

By necessity, I have to use a long FOR loop (N >~ 300,000). I have
made the operations inside the loop efficient enough that the first
40,000 iterations are relatively fast (~30 mins). Then it slows down
to a crawl, with the entire process taking >24 hours. I would
appreciate any advice how to speed this up.

The operation inside the loop involves matching between two (large)
FITS files and assigning the matches to another (previously created)
FITS structure. There are no new variable created per iteration, so
there should be no memory being used (each loop writes over the
variables anyways). I even create small substructures (e.g., >
sub_mystruct = mystruct[0:10]) so that I don't have to index the large
structures.

Any tip or advice would be much appreciated,
~Saurav
[Message index]
 
Read Message
Read Message
Previous Topic: Re: How to speed up large FOR loops?
Next Topic: Manipulation with 4D data in iVolume tool

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:20:27 PDT 2025

Total time taken to generate the page: 0.00439 seconds