diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php
index 7bd9f0f..95d7fa5 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentManager.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php
@@ -52,6 +52,16 @@ class CommentManager implements CommentManagerInterface {
   protected $urlGenerator;
 
   /**
+   * An array keyed by entity type. Each value is an array whose keys are
+   * field names and whose value is an array with two entries:
+   *   - type: The field type.
+   *   - bundles: The bundles in which the field appears.
+   *
+   * @return array
+   */
+  protected $fieldMap = array();
+
+  /**
    * Construct the CommentManager object.
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -87,17 +97,18 @@ public function getFields($entity_type_id) {
    * {@inheritdoc}
    */
   public function getAllFields() {
-    $map = $this->entityManager->getFieldMap();
-    // Build a list of comment fields only.
-    $comment_fields = array();
-    foreach ($map as $entity_type => $data) {
-      foreach ($data as $field_name => $field_info) {
-        if ($field_info['type'] == 'comment') {
-          $comment_fields[$entity_type][$field_name] = $field_info;
+    if (!$this->fieldMap) {
+      $map = $this->entityManager->getFieldMap();
+      // Build a list of comment fields only.
+      foreach ($map as $entity_type => $data) {
+        foreach ($data as $field_name => $field_info) {
+          if ($field_info['type'] == 'comment') {
+            $this->fieldMap[$entity_type][$field_name] = $field_info;
+          }
         }
       }
     }
-    return $comment_fields;
+    return $this->fieldMap;
   }
 
   /**
diff --git a/core/modules/comment/tests/Drupal/comment/Tests/CommentManagerTest.php b/core/modules/comment/tests/Drupal/comment/Tests/CommentManagerTest.php
new file mode 100644
index 0000000..8310174
--- /dev/null
+++ b/core/modules/comment/tests/Drupal/comment/Tests/CommentManagerTest.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\comment\Tests\CommentManagerTest.
+ */
+namespace Drupal\comment\Tests;
+
+use Drupal\comment\CommentManager;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * Tests the comment manager service.
+ *
+ * @see \Drupal\comment\CommentManager
+ */
+class CommentManagerTest extends UnitTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Comment manager tests',
+      'description' => 'Tests the comment manager service.',
+      'group' => 'Comment',
+    );
+  }
+
+
+  /**
+   * Tests the getAllFields method.
+   *
+   * @see \Drupal\comment\CommentManager::getAllFields()
+   *
+   * @group Drupal
+   * @group Comment
+   */
+  public function testGetAllFields() {
+    $entity_manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManager')
+      ->disableOriginalConstructor()
+      ->getMock();
+
+    $entity_manager->expects($this->once())
+      ->method('getFieldMap')
+      ->will($this->returnValue(array(
+        'node' => array(
+          'field_foobar' => array(
+            'type' => 'comment',
+          ),
+        ),
+      )));
+    $comment_manager = new CommentManager($entity_manager, $this->getMock('Drupal\Core\Config\ConfigFactoryInterface'), $this->getMock('Drupal\Core\StringTranslation\TranslationInterface'), $this->getMock('Drupal\Core\Routing\UrlGeneratorInterface'));
+    // First call with prime the static cache.
+    $cached_fields = $comment_manager->getAllFields();
+    // Should not trigger EntityManager::getAllFields().
+    $comment_fields = $comment_manager->getAllFields();
+    $this->assertSame($cached_fields, $comment_fields);
+  }
+
+}
