Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 14282)
+++ wp-includes/taxonomy.php	(working copy)
@@ -500,31 +500,42 @@
  * @return mixed Term Row from database. Will return false if $taxonomy does not exist or $term was not found.
  */
 function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw') {
-	global $wpdb;
+	global $wpdb, $wp_object_cache;
 
 	if ( ! is_taxonomy($taxonomy) )
 		return false;
 
-	if ( 'slug' == $field ) {
-		$field = 't.slug';
-		$value = sanitize_title($value);
-		if ( empty($value) )
+	$terms = $wp_object_cache->cache[$taxonomy];
+	$in_cache = false;
+	foreach ( $terms as $term )
+		if ( $term->$field == $value ) {
+			$term = wp_clone($term);
+			$in_cache = true;
+			break;
+		}
+
+	if ( ! $in_cache ) {
+		if ( 'slug' == $field ) {
+			$field = 't.slug';
+			$value = sanitize_title($value);
+			if ( empty($value) )
+				return false;
+		} else if ( 'name' == $field ) {
+			// Assume already escaped
+			$value = stripslashes($value);
+			$field = 't.name';
+		} else {
+			$field = 't.term_id';
+			$value = (int) $value;
+		}
+
+		$term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND $field = %s LIMIT 1", $taxonomy, $value) );
+		if ( !$term )
 			return false;
-	} else if ( 'name' == $field ) {
-		// Assume already escaped
-		$value = stripslashes($value);
-		$field = 't.name';
-	} else {
-		$field = 't.term_id';
-		$value = (int) $value;
+
+		wp_cache_add($term->term_id, $term, $taxonomy);
 	}
 
-	$term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = %s AND $field = %s LIMIT 1", $taxonomy, $value) );
-	if ( !$term )
-		return false;
-
-	wp_cache_add($term->term_id, $term, $taxonomy);
-
 	$term = sanitize_term($term, $taxonomy, $filter);
 
 	if ( $output == OBJECT ) {
