• 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
Re: OS version?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OS version?


  • Subject: Re: OS version?
  • From: Loukas Kalenderidis <email@hidden>
  • Date: Fri, 16 May 2003 14:51:46 +1000

On Thursday, May 15, 2003, at 10:59 PM, Emmanuel wrote:
At 11:20 PM -0700 14/05/03, Andrew Oliver wrote:
It's much faster to just request the specific preference setting you're
after:

do shell script "defaults read loginwindow SystemVersionStampAsString

This is an order of magnitude faster than dumping the entire defaults table.

Of course, that only makes it 300 times slower than 'system attribute
"sysv"', but the point is still valid :)

30 times faster than "read | grep" but still this makes "defaults" 100 times slower than "system attribute".

Cheers, AppleScript: "system attribute" is a matter of 140 microseconds on my prehistoric Pismo.

Emmanuel

Don't blame defaults, blame the `do shell script' call.

set n to 1000
set ticks to {}

StartTicks()
repeat n times
system attribute "sysv"
end repeat
set the end of ticks to StopTicks()

StartTicks()
repeat n times
do shell script ""
end repeat
set the end of ticks to StopTicks()

StartTicks()
repeat n times
do shell script "defaults read loginwindow SystemVersionStampAsString"
end repeat
set the end of ticks to StopTicks()

return ticks
--> {7, 739, 2702}

`do shell script' is not an answer for everything :P

Loukas

----

Loukas Kalenderidis
Angier Consulting Pty Ltd
_______________________________________________
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.

References: 
 >Re: OS version? (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: OS version?
  • Next by Date: Mail.app - rename Subject
  • Previous by thread: Re: OS version?
  • Next by thread: Re: OS version?
  • Index(es):
    • Date
    • Thread