Damn your computer is twice as fast as mine -:)

These are my tests:

on mouseUp
  put the ticks into startTime
  repeat 1000
    get the rect of the owner of me
  end repeat
  put the ticks into endTime
  put (endTime - startTime)/1000 into ownerRectTime
  
  put the ticks into startTime
  repeat 1000
    get the rect of group id 1114
  end repeat
  put the ticks into endTime
  put (endTime - startTime)/1000 into idRectTime
  
  put ownerRectTime && idRectTime
end mouseUp

This shows that a direct ID call is as expected 4 times faster than using
the owner property. In your example using the id is slower because you have
to do it twice.

We are probably crossing wires here a bit. I found that if you duplicate
groups with the same name - the owner property does not work as a unique
reference. Next I found that by leaving the name of the group empty and
cloning the groups as before - everything worked fine.

So I have 3 choices:

    1) Don't name the groups and use the owner property in the scripts

    2) keep track of the id's of the groups and store these along with an
array of id's of group members?

    3) Use 2) above but do it live each time I refer to the owner.

2) seemed tricky to code for and 3 which involved finding all the controls
and stepping up the order til you hit a group I figure was too slow for a
mouseMove handler.

> From: Richard Gaskin <[EMAIL PROTECTED]>
> Subject: Re: The owner...
> 
> Relatively speaking, yes.  Running both forms through MetaBench verifies
> that indeed "the owner of me" is about 80% faster.
> 
> But considering that parsing the long ID only takes 0.0022 ticks to execute,
> the flexibility will probably be worth a speed difference not likely to be
> noticeable by humans, at least as a workaround until we see the long ID
> returned (2.4 GM maybe?).  'Less of course you've some reason to run this
> several thousand times in a row, but even then the fast thing to do would be
> to parse it just once and then store the parent's long ID in its own var.
> 
> 
> These are the scripts I ran in MetaBench last time I looked into it (on a G4
> 500):
> 
> get the owner of me
> 
> 4 ticks to execute 10,000 times (0.0004 ticks/iteration)
> 
> 
> get the long id of grp ID (word 8 of the long id of me)
> 
> 22 ticks to execute 10,000 times (0.0022 ticks/iteration)
> 
> 
> MeteBench can be downloaded at:
> <ftp://ftp.fourthworld.com/MetaCard/4W_MetaBench.mc.sit.hqx>
> 

So here's for the long id in the owner in 2.4!


Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to