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

Home » Public Forums » archive » Re: More efficient method of appending to arrays when using pointers?
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: More efficient method of appending to arrays when using pointers? [message #74258 is a reply to message #74164] Tue, 04 January 2011 19:07 Go to previous message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
I don't know but I don't thing so. The use of the TEMPORARY function
allows to save time programming with large amounts of data (in my
experience) I didn't find any contradictions to this.
I think that the use of TEMPORARY is always better. You will lose
efficiency using small data (for example, single scalars or small
arrays).

The simple reason is that you are not duplicating memory. In the case
discussed above, you are not copying the content of your pointer, you
are just retrieving it.

You can do your own tests, for example:

a=PTR_NEW(BYTARR(10000000),/NO_COPY)

tt=SYSTIME(/SEC)
b=*a
PRINT, SYSTIME(/SEC)-tt

tt=SYSTIME(/SEC)
b=TEMPORARY(*a) ;; do not forget that you are losing the content of
your pointer
PRINT, SYSTIME(/SEC)-tt

nata
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to extract a scalar from a vector?
Next Topic: Re: Associating GeoTiFF tags with basic Mercator projection parameters?

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

Current Time: Tue Oct 14 15:10:45 PDT 2025

Total time taken to generate the page: 1.20122 seconds