diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 1144e9d..4834d8a 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -135,6 +135,7 @@ function _simpletest_format_summary_line($summary) {
  *   The test ID.
  */
 function simpletest_run_tests($test_list) {
+  simpletest_clean_cache();
   $test_id = db_insert('simpletest_test_id')
     ->useDefaults(array('test_id'))
     ->execute();
@@ -375,6 +376,7 @@ function _simpletest_batch_operation($test_list_init, $test_id, &$context) {
 function _simpletest_batch_finished($success, $results, $operations, $elapsed) {
   if ($success) {
     drupal_set_message(t('The test run finished in @elapsed.', array('@elapsed' => $elapsed)));
+    simpletest_clean_cache();
   }
   else {
     // Use the test_id passed as a parameter to _simpletest_batch_operation().
@@ -536,6 +538,7 @@ function simpletest_generate_file($filename, $width, $lines, $type = 'binary-tex
  * Removes all temporary database tables and directories.
  */
 function simpletest_clean_environment() {
+  simpletest_clean_cache();
   simpletest_clean_database();
   simpletest_clean_temporary_directories();
   if (\Drupal::config('simpletest.settings')->get('clear_results')) {
@@ -552,6 +555,20 @@ function simpletest_clean_environment() {
 }
 
 /**
+ * Removes all temporary database tables corresponding the an initial install.
+ *
+ * These tables are created during the first test of a test run, after the
+ * temporary site has been set up. Further tests use these tables instead of
+ * reinstalling Drupal.
+ */
+function simpletest_clean_cache() {
+  $tables = db_find_tables('fasttest%');
+  foreach ($tables as $table) {
+    db_drop_table($table);
+  }
+}
+
+/**
  * Removes prefixed tables from the database from crashed tests.
  */
 function simpletest_clean_database() {
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index e0b6858..dab6a6e 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -860,7 +860,7 @@ protected function setUp() {
 
     // Execute the non-interactive installer.
     require_once DRUPAL_ROOT . '/core/includes/install.core.inc';
-    install_drupal($parameters);
+    $this->installDrupal($parameters);
 
     // Import new settings.php written by the installer.
     Settings::initialize($directory);
@@ -955,6 +955,60 @@ protected function setUp() {
   }
 
   /**
+   * Installs Drupal, using the cached database tables if possible.
+   *
+   * If the cached database tables are not available, create them for
+   * use by further tests.
+   */
+  function installDrupal($settings = array()) {
+    $fast_prefix = 'fast' . $settings['parameters']['profile'] . '_';
+    if ($this->tableExistsOnHost($fast_prefix . 'users')) {
+      $this->copyTablesOnHost($fast_prefix, $this->databasePrefix);
+      install_drupal($settings + array('database_verified' => TRUE));
+    }
+    else {
+      install_drupal($settings);
+      $this->copyTablesOnHost($this->databasePrefix, $fast_prefix);
+    }
+  }
+
+  /**
+   * Return TRUE if a given table exists on the host environment.
+   */
+  function tableExistsOnHost($table) {
+    Database::renameConnection('default', 'simpletest_swap');
+    Database::renameConnection('simpletest_original_default', 'default');
+    $return = db_table_exists($table);
+    Database::renameConnection('default', 'simpletest_original_default');
+    Database::renameConnection('simpletest_swap', 'default');
+    return $return;
+  }
+
+  /**
+   * Copies all tables with one prefix and give them another prefix, on host.
+   *
+   * @param $sourceprefix
+   *   Prefix of tables to be copied (source).
+   * @param $destinationprefix
+   *   New prefix for copied tables.
+   */
+  function copyTablesOnHost($sourceprefix, $destinationprefix) {
+    Database::renameConnection('default', 'simpletest_swap');
+    Database::renameConnection('simpletest_original_default', 'default');
+    $tables = db_find_tables($sourceprefix . '%');
+    foreach ($tables as $table) {
+      $table = str_replace($sourceprefix, '', $table);
+      if (db_table_exists($destinationprefix . $table)) {
+        break;
+      }
+      db_query('CREATE TABLE ' . $destinationprefix . $table . ' LIKE ' . $sourceprefix . $table . ';');
+      db_query('INSERT INTO ' . $destinationprefix . $table . ' SELECT * FROM ' . $sourceprefix . $table);
+    }
+    Database::renameConnection('default', 'simpletest_original_default');
+    Database::renameConnection('simpletest_swap', 'default');
+  }
+
+  /**
    * Returns the parameters that will be used when Simpletest installs Drupal.
    *
    * @see install_drupal()
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 70bdf4a..b6e0ef8 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -502,6 +502,13 @@ function simpletest_script_setup_database($new = FALSE) {
 function simpletest_script_execute_batch($test_classes) {
   global $args, $test_ids;
 
+  // To speed up the execution of multiple tests, instead of going through
+  // the installation process for each test, the installation process is done
+  // once and cached. When starting a new batch this cache should be cleared
+  // as it may be outdated.
+  require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'simpletest') . '/simpletest.module';
+  simpletest_clean_cache();
+
   // Multi-process execution.
   $children = array();
   while (!empty($test_classes) || !empty($children)) {
