Cowell Computer Consulting

Get real about startup optimization

This will be a useful read for you if you are looking to speed up the time between when you start the login process and when your key startup items are loaded.

There are a plethora of tutorials out there on how to improve your login startup times in OS X. Some suggest adding delays between startup items. Some suggest using an applescript to do your launching.

Time to usefulness

It is possible to measure the amount of time that has passed until all your login items have loaded, but let's get real, many of the startup items could be started at any point within the first few minutes logging in. Unfortunately, when your login items (from your account preferences) are executed they are all started at once. This means that most of the programs aren't ready until all the programs are ready. We should then be measuring how long it takes before you can use your key startup items, rather than timing how long it takes until all startup items are launched.

The problem with the applescript solution

I've seen some very elegant applescript solutions. For example:

 tell application "Firefox" to launch
 tell application "Apple Help" to launch

Unfortunately, when you use an applescript in this way, the applescript will scan through your applications folder to find the apps you've told it to launch. That means lots and lots of unneeded disk activity, which is your primary bottleneck on startup.

Shell script

I recommend writing a shell script. This code sucks, but it works. I've added a start delay aka. startup as this is called with the other startup items and I've added delays aka. between between the items to stagger the launch process.

#!/bin/sh

startup=15
between=1
sleep $startup
open /Applications/smcFanControl.app/
sleep $between
open /Applications/Spirited\ Away.app/
sleep $between
open /Applications/Mozy.app/Contents/Resources/Mozy\ Status.app/
sleep $between
open /Applications/Microsoft\ AutoUpdate.app/Contents/MacOS/Microsoft\ AU\ Daemon.app/
sleep $between
open /Applications/Palm/Transport\ Monitor/
sleep $between
open /Applications/iTunes.app/Contents/Resources/iTunesHelper.app/

You may need to wrap this in an applescript ala:

do shell script "mystartupscript.sh"

add this to your login items.

Pros

-I can start using quicksilver much more quickly now.

-My computer is more responsive in the first couple minutes after login.

Cons

-How often do I actually restart my computer ? Rarely, so the benefit is minimal.

-More difficult to maintain than using standard login items.

I'd also recommend that you check out Lingon for speeding up your startup in general.

http://lingon.sourceforge.net/

Update: Avi Flax has some comments about startup optimization

http://aviflax.com/post/os-x-tip-staggered-login-items/

Posted by Luke Cowell on May 17, 2007 at 07:08 PM

Comments: 3 (view/add your own) Tags: OSX, Tips

Quicksilver Compound Commands with Delays

I been using quicksilver for a while and it's a great tool. One thing that disappointed me was that when building triggers I could figure out how to couple several commands together. I found this article which does a great explanation of it.

You need advanced features enabled etc. I won't re-explain what the previous author did a great job of explaining, but I will explain how to overcome one limitation they mentioned.

How do I order and add delays between commands ?

-Enable the Terminal Commands module

-For the sake of a simple illustration I'm going to use large type commands. Create and save 2 large type commands using the encapsulate [^+Enter] and save commands.

-Enter the following:

.sleep 5 [tab]

run command in shell [enter]

[^+Enter] (to encapsulate command)

Save command to file [enter]

Let's try it out. Use the comma trick to group your 3 commands together and then choose to run. Neet - delay.

Extending the concepts

-you can use the comma trick to build triggers with multiple commands coupled together.

-you can change the delay between commands by modifying the number after sleep.

-you can couple as many commands together as you want using this technique, adding delays when required.

Posted by Luke Cowell on May 10, 2007 at 07:50 AM