If you are using Spotlight as a Finder search replacement, you've seen that is fast, but not fast enough. To optimize Spotlight search times, I've tried to renice the process that's behind the searches. Looking at the CPU usage in the Terminal (via top -o cpu) during searches, I've seen that a process named mds is the one that does it all. Using an AppleScript to renice the mds process, we can cut research times even at half.
Here's the script:
tell application "Terminal"
do shell script ¬
"sudo renice -20 -p `ps -axww | grep '[/]mds'| awk '{print $1}'`"
quit "terminal"
end tell
Save the script as an application, and using the Login Items tab of the Accounts System Preferences panel, list it as a startup file. Now you have to logout and re-login. You'll se a Terminal window appear and disappear soon after. To check if the renice command has been successful, you can open the Terminal and type:
ps -axww -l nice | grep '[/]mds'
and check if the sixth field is -20.
[robg adds: I'm running this mainly to see what others' experiences are with it. I tried it, and I must admit, I don't really see any increase in the speed of Spotlight's results (which is another of my pet peeves with it -- for a supposedly indexed system, it's astonishingly slow at what seems like simple stuff). The rest of this hint details how to allow the renice process to run via sudo without requiring a password. I personally wouldn't do that, as I much prefer the minor inconvenience of typing the password. However, it's here in the interest of completeness...]
The renice command has to be given as "root," and to have it work without giving an admin password every time, you have to modify the /etc/sudoers file. To do that, open the Terminal and type:
sudo visudo
At some place in the file, add the following line:
%admin ALL = NOPASSWD: /usr/bin/renice
That let's any admin users run the renice command without giving their admin passwords. Save and that's done.

