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

Home » Public Forums » archive » Pass by value and performance
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: Pass by value and performance [message #46784 is a reply to message #46719] Fri, 16 December 2005 09:29 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
Kenneth P. Bowman wrote:
> A cautionary note on argument passing ...
>
> I have a large code that does a lot of interpolation in
> multi-dimensional arrays. Being a clever IDL programmer (too clever by
> half, as it turns out), I package these arrays into structures along
> with various information about the arrays. When these arrays are then
> passed, for example, into INTERPOLATE, as
>
> result = INTERPOLATE(data.array, x, y, z)
>
> the array is passed by value, which entails making a copy of the array.
> When these arrays get large, this causes a big performance hit. So, I
> am in the process of making my code less clever (and uglier) but much
> faster.

It's nice that we have to worry about these things in IDL.

I'm working in MATLAB right now helping a colleague run a large
simulation and managing memory when you can only pass by value is a real
pain/annoyance. Talk about a performance hit:

??? Error using ==> zeros
Out of memory. Type HELP MEMORY for your options.

The inability to pass by reference in MATLAB is *insane*. An annoyance
when writing everyday code, a real hindrance when array sizes balloon.

-Rick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: tutorials
Next Topic: Re: Using zlib and IDL 6.1 in a DLM

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

Current Time: Fri Oct 10 14:53:01 PDT 2025

Total time taken to generate the page: 2.96181 seconds