Index: src/wp-includes/class-wp-theme.php
===================================================================
--- src/wp-includes/class-wp-theme.php	(revision 42198)
+++ src/wp-includes/class-wp-theme.php	(working copy)
@@ -988,7 +988,12 @@
 		$label = sanitize_key( 'files_' . $this->cache_hash . '-' . $this->get( 'Version' ) );
 		$transient_key = substr( $label, 0, 29 ) . md5( $label );
 
-		$all_files = get_transient( $transient_key );
+		$all_files = false;
+
+		if( ! WP_DEBUG ) {
+			$all_files = get_transient( $transient_key );
+		}
+		
 		if ( false === $all_files ) {
 			$all_files = (array) self::scandir( $this->get_stylesheet_directory(), null, -1 );
 
@@ -996,7 +1001,9 @@
 				$all_files += (array) self::scandir( $this->get_template_directory(), null, -1 );
 			}
 
-			set_transient( $transient_key, $all_files, HOUR_IN_SECONDS );
+			if( ! WP_DEBUG ) {
+				set_transient( $transient_key, $all_files, HOUR_IN_SECONDS );
+			}
 		}
 
 		// Filter $all_files by $type & $depth.
