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 #38641 is a reply to message #38531] Thu, 18 March 2004 14:48 Go to previous messageGo to previous message
Sidney Cadot is currently offline  Sidney Cadot
Messages: 7
Registered: October 2002
Junior Member
Ben Tupper wrote:

> Sidney Cadot wrote:
>
>> 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.
>>
>
> How about this ? [[code snipped]]

Thanks for the effort, but this sort of defeats the purpose of the whole
exercise, which is to have a fast mapping function. Your solution is
linear search (the TAG_NAMES and WHERE functions), which is too slow for
out application.

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: Fri Oct 10 06:12:14 PDT 2025

Total time taken to generate the page: 0.63992 seconds