Index: drush
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/drush,v
retrieving revision 1.25
diff -u -p -r1.25 drush
--- drush	10 Nov 2010 13:57:54 -0000	1.25
+++ drush	5 Feb 2011 01:41:12 -0000
@@ -41,6 +41,8 @@ if [ -z $COLUMNS ] && [ -n "$TERM" ] && 
   fi
 fi
 
+export APCCACHE='/dev/shm/drush.apc'
+
 if [ ! -z "$DRUSH_PHP" ] ; then
   # Use the DRUSH_PHP environment variable if it is available.
   php="$DRUSH_PHP"
Index: drush.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/drush.php,v
retrieving revision 1.96
diff -u -p -r1.96 drush.php
--- drush.php	17 Jan 2011 12:34:17 -0000	1.96
+++ drush.php	5 Feb 2011 01:41:12 -0000
@@ -21,6 +21,11 @@ if (version_compare(phpversion(), DRUSH_
 
 define('DRUSH_BASE_PATH', dirname(__FILE__));
 
+// Load the stored APC opcode cache, if available.
+define('DRUSH_APC_CACHE', getenv('APCCACHE'));
+if (strlen(DRUSH_APC_CACHE) > 0 && function_exists('apc_bin_loadfile') && is_readable(DRUSH_APC_CACHE)) {
+  apc_bin_loadfile(DRUSH_APC_CACHE);
+}
 
 define('DRUSH_REQUEST_TIME', microtime(TRUE));
 
@@ -138,6 +143,11 @@ function drush_main() {
     }
   }
 
+  // Store the APC opcode cache.
+  if (!empty($apccache) && function_exists('apc_bin_dumpfile') && (is_writable($apccache) || is_writable(dirname($apccache)))) {
+    apc_bin_dumpfile(NULL, NULL, DRUSH_APC_CACHE);
+  }
+
   // We set this context to let the shutdown function know we reached the end of drush_main();
   drush_set_context("DRUSH_EXECUTION_COMPLETED", TRUE);
 
