• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why Slow Then Fast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why Slow Then Fast


  • Subject: Why Slow Then Fast
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 01 Mar 2011 15:33:47 -0600

I first commented on this on Sep 7, 2010. Here is a new twist on the problem. (OS 10.6.6)

The original problem. ------------
I have an AppleScripted application bundle named "Write_Appls_Report".
The script (about 90% removed) looks like this ...

on main()
-- opens a file to which the report is written
-- writes install history to the file
-- gets an alias list of applications in the applications folder
(path to applications folder) as alias -- set appFolder to path to applications folder
set applPosixList to my getApplsList(the result)


-- less than 1 second elapsed to get here


set itemNamesList to {}
repeat with i from 1 to (count items of applPosixList)
set applPosixPath to (item i of applPosixList)
set itemNamesList to my formatAndWrite(applPosixPath, itemNamesList, leaders, fileRefNr)
end repeat
-- on first run this takes over 40 seconds 


-- close the file
end main -------------------------------------

The problem is that on first run the elapsed time is always over 40 seconds, but if this script is immediately run again, the total elapsed time is only 4 to 6 seconds.
The problem is in the repeat ... end repeat loop, but why?

Here is the new twist on the problem. ------------
I have another AppleScripted application bundle called "Annotate Preferences". It also gets a list of applications from various locations, then annotates the comment of the associated preference file in the Preferences folder with the name of the application creating the file.

If I restart, then run "Annotate Preferences", then run "Write_Appls_Report", the elapsed time for "Write_Appls_Report" is only 4 to 6 seconds. ("Annotate Preferences" does not seem to run slowly on first run.)

This seems to indicate that the problem is not in the script, but has something to do with the system or Finder. But, I haven't a clue what this would be. Anyone?

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why Slow Then Fast
      • From: Thomas Fischer <email@hidden>
    • Re: Why Slow Then Fast
      • From: Christopher Stone <email@hidden>
    • Re: Why Slow Then Fast
      • From: Shane Stanley <email@hidden>
    • Re: Why Slow Then Fast
      • From: KOENIG Yvan <email@hidden>
  • Prev by Date: Re: passing data
  • Next by Date: Re: Why Slow Then Fast
  • Previous by thread: Re: passing data
  • Next by thread: Re: Why Slow Then Fast
  • Index(es):
    • Date
    • Thread