Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Avoid After Effects slowdowns Apps
After Effects normally taxes your Mac's resources heavily, especially when you don't have a lot of memory. Using renice on the processes related to After Effects can greatly improve the performance of other applications you may be running.

By using renice on the processes related to After Effects and some others related to the system your system will be more responsive. Just launch this script after launching After Effects and render a few frames (RAM preview, render). The script will renice the priority of the After Effects processes, and some others that are related.

And then you may run iTunes, Dropbox, and other programs without problems while working with After Effects.
tell application "Finder" to set theApps to name of every process
activate
set newPriority to "15"
set theApp to "After Effects"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "CS5.5ServiceManager"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "Adobe QT32 Server"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "iTunes"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "Dropbox"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "aeselflink"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "kernek_task"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

on Renice(newPriority, thePID, theApp)
  try
    set theConfirmation to (do shell script "renice " & newPriority & " -p " & thePID)
  on error
    set theConfirmation to (do shell script "renice " & newPriority & " -p " & thePID with administrator privileges)
  end try
end Renice

[crarko adds: I haven't tested this one. The script lowers the priority of all the processes/applications included in it. The newPriority value of 15 is lower than the default value of 0. Given that renice is just a suggestion to the kernel about how to schedule the process the results can vary, depending on other factors in system. One obvious side effect here is that lowering the priority of After Effects can greatly increase the rendering time of a job. This may depend on the number of processor cores you have available. I guess my point is that doing this may or may not help with performance. It depends on what else your system is doing, and you might modify the script to accomodate that if you feel comfortable doing that.]
    •    
  • Currently 3.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[6,061 views]  

Avoid After Effects slowdowns | 5 comments | Create New Account
Click here to return to the 'Avoid After Effects slowdowns' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Avoid After Effects slowdowns
Authored by: humanbulk on Dec 12, '11 01:32:10AM

Correction:

set theApp to "kernel_task"

is with "L"



[ Reply to This | # ]
Avoid After Effects slowdowns
Authored by: humanbulk on Dec 12, '11 01:38:21AM

I improve the script for my own system. Also I add a little clock to reset the priority set every minute.


repeat with shotcount from 1 to 99999
tell application "Finder" to set theApps to name of every process

set newPriority to "5"
set theApp to "After Effects"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "aerendercore"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "aerender"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "aeren"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "20"
set theApp to "CS5.5ServiceManager"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "0"
set theApp to "Adobe QT32 Server"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "iTunes"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "Dropbox"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "15"
set theApp to "aeselflink"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "-15"
set theApp to "kernel_task"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "-15"
set theApp to "WindowServer"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "-5"
set theApp to "Finder"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

set newPriority to "-5"
set theApp to "Dock"
set thePID to do shell script "ps -axww | /usr/bin/grep '[/]" & theApp & "'| awk '{print $1}' | head -1"
Renice(newPriority, thePID, theApp)

delay (60 * 1) -- delay one minute
end repeat


on Renice(newPriority, thePID, theApp)
try
set theConfirmation to (do shell script "renice " & newPriority & " -p " & thePID)
on error
set theConfirmation to (do shell script "renice " & newPriority & " -p " & thePID with administrator privileges)
end try
end Renice



[ Reply to This | # ]
Avoid After Effects slowdowns
Authored by: manxman on Dec 12, '11 03:12:36PM

Oh, I see. We have to run several shell scripts on our Mac system to make a famous program run properly on the machines it was allegedly designed for, and costs a reasonable amount (arm, leg, circa 1000).

I quote, "Adobe After Effects CS5.5 is the industry-leading solution for creating sophisticated motion graphics and cinematic visual effects."

Or have I missed something?

Yes, I work in broadcasting.

Chris



[ Reply to This | # ]
Avoid After Effects slowdowns
Authored by: angelosphere on Dec 16, '11 06:06:13AM

You miss the effect that all programs (processes) started by a user have the same "nice" level. Or in other words the same priority.

Of course it makes sense to tamper with nice level (aka renicing) if you are low on resources or need special behaviour. That is not the applications (or vendors) fault nor the OS's fault. In fact it is nice that Mac OS X is a unix OS and gives you so easy options to "renice" your processes.



[ Reply to This | # ]
Avoid After Effects slowdowns
Authored by: phrend on Jan 09, '12 07:41:31AM
I have not done much with AppleScript, but can someone please tell me why the following line is necessary?
tell application "Finder" to set theApps to name of every process
The rest of the script doesn't seem to do anything with the variable, "theApps." Thanks!

[ Reply to This | # ]