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

Home » Public Forums » archive » Re: 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
Re: How to speed up large FOR loops? [message #79812 is a reply to message #79811] Tue, 10 April 2012 09:17 Go to previous messageGo to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi,

Do you concatenate arrays in your loop?

e.g: out = [out, tmp]



On 04/10/2012 05:48 PM, Saurav Dhital wrote:
> 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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Creating netCDF file
Next Topic: How to speed up large FOR loops?

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

Current Time: Wed Oct 08 17:28:17 PDT 2025

Total time taken to generate the page: 0.00486 seconds