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

Home » Public Forums » archive » Re: Storing data in an array inside a structure MUCH slower in IDL 8.2.2
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: Storing data in an array inside a structure MUCH slower in IDL 8.2.2 [message #83333] Thu, 21 February 2013 10:11 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi all,

I can reproduce the problem using Mark's code. As you pointed out, this is indeed because of operator overloading.

In IDL 8.2.1 and earlier, if you tried to do "mystruct.data[i]", and the "data" field was an object (say a HASH), then IDL would throw an error. The only way you could access the index "i" for an overloaded object was to use parentheses, like "(mystruct.data)[i]".

In IDL 8.2.2 we now check if that field is an overloaded object, and then either do regular array indexing or operator overloading. This eliminates the need for the parentheses. Unfortunately, the check for the overloaded object was being done in a naive, expensive way.

I have fixed the bug, and the fix will be in the next IDL service pack.

With the fix:
IDL> mgh_test_structure, N_DATA=1000000,/use
IDL 8.2.3: loading 1000000 long-integer values into structure-field array took 0.4820 s

Thanks for finding the bug and providing such a simple reproduce case!

-Chris
ExelisVIS
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Calculating weighted mean for an array
Next Topic: Re: IDL use by OS

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

Current Time: Wed Oct 08 20:11:10 PDT 2025

Total time taken to generate the page: 0.00447 seconds