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

Home » Public Forums » archive » Compiling file with many functions: huge performance difference between IDL and IDLDE
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: Compiling file with many functions: huge performance difference between IDL and IDLDE [message #38648 is a reply to message #38531] Thu, 18 March 2004 12:32 Go to previous messageGo to previous message
Sidney Cadot is currently offline  Sidney Cadot
Messages: 7
Registered: October 2002
Junior Member
Mirko Vukovic wrote:
>> P.S. the reason we're doing this is that we need to implement a
>> string-based map with optiomal performance, like this:
>>
>> FUNCTION f_tom
>> RETURN, 123
>> END
>>
>> FUNCTION f_dick
>> RETURN, 456
>> END
>>
>> FUNCTION f_harry
>> RETURN, 789
>> END
>>
>> FUNCTION f, name
>> CATCH, error_status
>> IF error_status EQ 0 THEN RETURN, -1
>> RETURN, call_function("f_" + name)
>> END
>
>
> Out of curiosity, would a structure work here:
> a={f_tom:123,f_dick:456,f_harry:789...} ?
>
> It could be created using create_struct.
>
> Retrieve info using
>
> a=str.f_dick
>
> Curious minds want to know :-)

Your idea is sound, but I am not aware of a way to retrieve the index of
a tag-name based on its name.

You assume that "f_dick" is available at compile time, whereas I need to
resolve the string at runtime. Something like this would work:

i = TAG_INDEX("f_dick", str)
value = str.(i)

... But only if functionality to get a tag index can be retrieved from a
struct (anyone knows how to do this?) and if its fast, i.e. if IDL
implements it via a hash table or similar.

Best regards,

Sidney
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: image registration, robust
Next Topic: compiling itools and utilities

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

Current Time: Wed Oct 08 18:20:41 PDT 2025

Total time taken to generate the page: 0.00421 seconds