Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1244
diff -u -p -r1.1244 common.inc
--- includes/common.inc	21 Oct 2010 19:31:39 -0000	1.1244
+++ includes/common.inc	2 Nov 2010 04:44:57 -0000
@@ -838,9 +838,12 @@ function drupal_http_request($url, array
 
     // Mark that this request failed. This will trigger a check of the web
     // server's ability to make outgoing HTTP requests the next time that
-    // requirements checking is performed.
-    // See system_requirements()
-    variable_set('drupal_http_request_fails', TRUE);
+    // requirements checking is performed. If the variable has already been
+    // set, avoid setting it again since variable_get() is expensive.
+    // @see system_requirements()
+    if (!variable_get('drupal_http_request_fails', TRUE)) {
+      variable_set('drupal_http_request_fails', TRUE);
+    }
 
     return $result;
   }
