compileIt for revolution?

Alex Tweedly alex at tweedly.net
Wed Jun 22 06:21:17 EDT 2005


MisterX wrote:

>[ about the need for more speed for some things ....]
>Example: The HotKeyN2O stack stores all properties of all
>controls in a card when the user opens the card. The props
>are all in array form which cannot be stored into another
>array (time based array of object changes). So for each
>object i have to translate array[key]=data to <key>data</key>.
>
>This in turn is stored into a time-based array. So if i need
>to restore the property (any) for any object and at any time,
>it's ultra easy - except that the translation process is so
>slow after 10 controls trasnlated that it's USELESS if i dont
>write that into a real-compiled external. 
>  
>
I agree with you about the need for more speed for some applications 
(and sorry Dan, but I've seen requests for more speed a number of times 
on this list ... sometimes they can be overcome by creative use of 
Transcript's features in unusual ways, but I'm not convinced that's 
always possible, nor that it should be necessary to use non-obvious 
programming tricks, at the cost of loss of readability and 
maintainability, when some improvements in native performance would do 
it better)

But in this example, there may be a better way to organize your (Mr. 
X's) data that would be fast enough.  2 possibilities I see

1. data[key] contains
  time of change, the new value
  time of change, the new value
  etc.

then you can directly index the individual property, then find the 
appropriate line entry (which you'd keep sorted). If you needed to, you 
could then binary search through the lines for the most recent change 
before the time desired..

2. the data is in a time-based array, but as a 'combine'd array-as-list.
So you'd simply
  find the array entry based on time    put data[theTime] into myProps
  split myProps by cr and comma
  so the value of a property would be myProp[theProp]

Not sure which of those would be better - depends on the full set of 
operations you need to do.

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.8/22 - Release Date: 17/06/2005



More information about the use-livecode mailing list