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

Home » Public Forums » archive » Re: fastest operations/fctns.
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: fastest operations/fctns. [message #24780] Fri, 20 April 2001 17:46 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Johnny Lin <donotreply@interbulletin.bogus> writes:
> hi folks,
>
> i was wondering, has anyone compiled a ranked list of the relative
> speeds of IDL operations functions? i've read postings re general
> rules of thumb, but was wondering if anything more specific and
> complete is available online anywhere.

The fastest operation is the one that takes the least amount of time
:-)

Actually I'm being quite serious. If you really have a deep question
about the speed difference between two implementations, then go ahead
and try both and see which is fastest.

Things to bear in mind:

* vectorize where you can; if you can vectorize the inner loop, then
you are usually fine.

* there really are not *that* many different ways to do things; You
add with the "+" symbol, divide with the "/" symbol, etc.

* the RSI web page does have some good tips about speeding up your
code. Things like "group scalars into parentheses;" or "take
common expressions outside of FOR loops;" or "how to speed up array
indexing assignments"

* not all platforms are the same speed; some do certain operations
faster than others, even with the same IDL code.

Some techniques discussed here are not really about speed. For
example, I and others have mentioned "chunking," or dividing your huge
array up into smaller segments for processing. While this may save
time, what it really does is save *memory*. If you use too much
memory then your computer slows way down.

One legitimate question was over how to quickly expand an array (using
REBIN vs the "#" operator). You can find the newsgroup discussion --
with timings -- here:

http://cow.physics.wisc.edu/~craigm/idl/archive/msg00327.htm l

There are some other fancy tips like using NOZERO keyword for array
creation, but this is getting to be a fairly "niche" optimization.

Search around the archive and you can find other examples.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Equivalent of EXCEL LINEST function?
Next Topic: Re: indexing over structure tags

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

Current Time: Wed Oct 08 14:57:08 PDT 2025

Total time taken to generate the page: 0.00366 seconds