Re: possible bug? Radically different time profile for list access in script objects or by explicit reference.
Re: possible bug? Radically different time profile for list access in script objects or by explicit reference.
- Subject: Re: possible bug? Radically different time profile for list access in script objects or by explicit reference.
- From: has <email@hidden>
- Date: Sat, 9 Mar 2002 11:17:04 +0000
Christopher Nebel wrote:
[list access speeds]
>
If the cause was as simple as Paul guesses, I
>
would have fixed this a long time ago, but unfortunately it's not.
>
AppleScript takes a number of precautions to protect itself against
>
circular structures, and one of them leads to this slow-down. I'm not
>
convinced that it really needs to do this, but changing it is not
>
something to take lightly.
I've been lurking on the macscrpt archives for the last week or so
following the thread in question - it really is a fascinating read (well,
the bits I can understand, anyway;). For months now I've had a terribly
strong gut feeling that repeat loops in AS were grindingly slow; now I
realise that it's not loops per-se that are the problem, but using them to
iterate across lists.
Anyway; Chris, while I appreciate what you're saying about deep changes not
being simple to make or something to be rushed into, perhaps I could quote
something Paul Skinner wrote to the macscrpt list:
[...]
So, just to clarify, On my PG G3 400 OS 10.1.3/AS 1.8.1...
Looping through a 50000 item list takes 42 minutes.
Looping through a reference to a 50000 item list takes 7 seconds.
Looping through a reference to "MY" 50000 item list takes 8 seconds.
Looping through a script object's 50000 item list takes 2 seconds.
Looping through "MY" 50000 item list takes 2 seconds.
[...]
Which suggests a few things to me:
1. the checking you describe is inconsistently enforced to begin with.
[Perhaps AS itself concurs with your own feeling that it's unnecessary?]
2. it would seem that users have survived its partial omission this far
without serious effects [though it's possible this is due entirely to
luck/author-skills in not stepping on any landmines]
2. as the various hacks described on the macscrpt list are more widely
disseminated, folk are going to work round this checking process anyway.
Even if it does mean uglier code and possible security issues [which they
may not even realise], the benefits are too great to ignore.
3. that two seconds versus 42 minutes sounds like a _damn_ good reason for
doing some kind of 'bug fix', even if it isn't strictly a bug as such.
I do hope you folks on the AS team will consider this issue on a future update.
Many thanks (and to the macscrpt folks too),
has (off to start hacking up his code...)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.