diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php
index fc3411e..1ad6649 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -65,6 +65,17 @@ class Comment extends ContentEntityBase implements CommentInterface {
   use EntityChangedTrait;

   /**
+   * Whether the comment is being previewed or not.
+   *
+   * The variable is set to public as it will give a considerable performance
+   * improvement. See https://www.drupal.org/node/2498919.
+   *
+   * @var true|null
+   *   TRUE if the comment is being previewed and NULL if it is not.
+   */
+  public $in_preview = NULL;
+
+  /**
    * The thread for which a lock was acquired.
    */
   protected $threadLock = '';
