diff --git a/features.module b/features.module
index 52704e7..a0c0436 100644
--- a/features.module
+++ b/features.module
@@ -227,7 +227,10 @@ function features_theme() {
  */
 function features_flush_caches() {
   features_rebuild();
-  features_get_modules(NULL, TRUE);
+  // Don't flush the modules cache during installation, for performance reasons.
+  if (variable_get('install_task') != 'done') {
+    features_get_modules(NULL, TRUE);
+  }
   return array();
 }
 
@@ -278,26 +281,38 @@ function features_help($path, $arg) {
  * Implements hook_modules_disabled().
  */
 function features_modules_disabled($modules) {
-  // Find any features modules that were disabled.
-  if ($modules = array_intersect(array_keys(features_get_features()), $modules)) {
-    foreach ($modules as $module) {
-      features_disable_feature($module);
+  // Go through all modules and gather features that can be disabled.
+  $items = array();
+  foreach ($modules as $module) {
+    if ($feature = feature_load($module)) {
+      $items[$module] = array_keys($feature->info['features']);
     }
   }
+
+  if (!empty($items)) {
+    _features_restore('disable', $items);
+    // Rebuild the list of features includes.
+    features_include(TRUE);
+  }
 }
 
 /**
  * Implements hook_modules_enabled().
  */
 function features_modules_enabled($modules) {
-  // Find any features modules that were enabled.
-  if ($modules = array_intersect(array_keys(features_get_features()), $modules)) {
-    foreach ($modules as $module) {
-      features_enable_feature($module);
+  // Go through all modules and gather features that can be enabled.
+  $items = array();
+  foreach ($modules as $module) {
+    if ($feature = feature_load($module)) {
+      $items[$module] = array_keys($feature->info['features']);
     }
   }
-  // Make sure any new files are included now that a new module is enabled.
-  features_include(TRUE);
+
+  if (!empty($items)) {
+    _features_restore('enable', $items);
+    // Rebuild the list of features includes.
+    features_include(TRUE);
+  }
 }
 
 /**
@@ -383,7 +398,38 @@ function features_include_defaults($components = NULL, $reset = FALSE) {
  * Feature object loader.
  */
 function feature_load($name, $reset = FALSE) {
-  return features_get_features($name, $reset);
+  // Use an alternative code path during installation, for better performance.
+  if (variable_get('install_task') != 'done') {
+    static $features;
+
+    if (!isset($features[$name])) {
+      // Set defaults for module info.
+      $defaults = array(
+        'dependencies' => array(),
+        'description' => '',
+        'package' => 'Other',
+        'version' => NULL,
+        'php' => DRUPAL_MINIMUM_PHP,
+        'files' => array(),
+        'bootstrap' => 0,
+      );
+      $info = drupal_parse_info_file(drupal_get_path('module', $name) . '/' . $name . '.info');
+
+      $features[$name] = FALSE;
+      if (!empty($info['features']) && empty($info['hidden'])) {
+        // Build a fake file object with the data needed during installation.
+        $features[$name] = new stdClass;
+        $features[$name]->name = $name;
+        $features[$name]->type = 'module';
+        $features[$name]->info = $info + $defaults;
+      }
+    }
+
+    return $features[$name];
+  }
+  else {
+    return features_get_features($name, $reset);
+  }
 }
 
 /**
@@ -844,24 +890,6 @@ function features_rebuild($rebuild = array()) {
 }
 
 /**
- * Wrapper around _features_restore().
- */
-function features_disable_feature($module) {
-  $feature = feature_load($module);
-  $items[$module] = array_keys($feature->info['features']);
-  return _features_restore('disable', $items);
-}
-
-/**
- * Wrapper around _features_restore().
- */
-function features_enable_feature($module) {
-  $feature = feature_load($module);
-  $items[$module] = array_keys($feature->info['features']);
-  return _features_restore('enable', $items);
-}
-
-/**
  * Utility functions ==================================================
  */
 
