diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
index ea39c51..d4df9eb 100644
--- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
@@ -109,6 +109,13 @@
   protected $pluginManager;
 
   /**
+   * A boolean indicating whether or not this display has been initialized.
+   *
+   * @var bool
+   */
+  protected $initialized = FALSE;
+
+  /**
    * {@inheritdoc}
    */
   public function __construct(array $values, $entity_type) {
@@ -131,8 +138,6 @@ public function __construct(array $values, $entity_type) {
     parent::__construct($values, $entity_type);
 
     $this->originalMode = $this->mode;
-
-    $this->init();
   }
 
   /**
@@ -146,8 +151,9 @@ public function id() {
    * {@inheritdoc}
    */
   public function preSave(EntityStorageInterface $storage, $update = TRUE) {
-    // Sort elements by weight before saving.
-    uasort($this->content, 'Drupal\Component\Utility\SortArray::sortByWeightElement');
+    // Save elements based on the field name to ensure a consistent order.
+    ksort($this->content);
+    ksort($this->hidden);
     parent::preSave($storage, $update);
   }
 
@@ -155,6 +161,7 @@ public function preSave(EntityStorageInterface $storage, $update = TRUE) {
    * {@inheritdoc}
    */
   public function calculateDependencies() {
+    $this->init();
     parent::calculateDependencies();
     $target_entity_type = \Drupal::entityManager()->getDefinition($this->targetEntityType);
 
@@ -213,40 +220,47 @@ public function toArray() {
    * - or that are not supposed to be configurable.
    */
   protected function init() {
-    // Fill in defaults for extra fields.
-    $context = $this->displayContext == 'view' ? 'display' : $this->displayContext;
-    $extra_fields = \Drupal::entityManager()->getExtraFields($this->targetEntityType, $this->bundle);
-    $extra_fields = isset($extra_fields[$context]) ? $extra_fields[$context] : array();
-    foreach ($extra_fields as $name => $definition) {
-      if (!isset($this->content[$name]) && !isset($this->hidden[$name])) {
-        // Extra fields are visible by default unless they explicitly say so.
-        if (!isset($definition['visible']) || $definition['visible'] == TRUE) {
-          $this->content[$name] = array(
-            'weight' => $definition['weight']
-          );
-        }
-        else {
-          $this->hidden[$name] = TRUE;
+    if (!$this->initialized) {
+      // Fill in defaults for extra fields.
+      $context = $this->displayContext == 'view' ? 'display' : $this->displayContext;
+      $extra_fields = $this->entityManager()->getExtraFields($this->targetEntityType, $this->bundle)[$context];
+      foreach ($extra_fields as $name => $definition) {
+        if (!isset($this->content[$name]) && !isset($this->hidden[$name])) {
+          // Extra fields are visible by default unless they explicitly say so.
+          if (!isset($definition['visible']) || $definition['visible'] == TRUE) {
+            $this->content[$name] = array(
+              'weight' => $definition['weight']
+            );
+          }
+          else {
+            $this->hidden[$name] = TRUE;
+          }
         }
       }
-    }
 
-    // Fill in defaults for fields.
-    $fields = $this->getFieldDefinitions();
-    foreach ($fields as $name => $definition) {
-      if (!$definition->isDisplayConfigurable($this->displayContext) || (!isset($this->content[$name]) && !isset($this->hidden[$name]))) {
-        $options = $definition->getDisplayOptions($this->displayContext);
+      // Fill in defaults for fields.
+      $fields = $this->getFieldDefinitions();
+      foreach ($fields as $name => $definition) {
+        if (!$definition->isDisplayConfigurable($this->displayContext) || (!isset($this->content[$name]) && !isset($this->hidden[$name]))) {
+          $options = $definition->getDisplayOptions($this->displayContext);
 
-        if (!empty($options['type']) && $options['type'] == 'hidden') {
-          $this->hidden[$name] = TRUE;
-        }
-        elseif ($options) {
-          $this->content[$name] = $this->pluginManager->prepareConfiguration($definition->getType(), $options);
+          if (!empty($options['type']) && $options['type'] == 'hidden') {
+            $this->hidden[$name] = TRUE;
+          }
+          elseif ($options) {
+            $this->content[$name] = $this->pluginManager->prepareConfiguration($definition->getType(), $options);
+          }
+          // Note: (base) fields that do not specify display options are not
+          // tracked in the display at all, in order to avoid cluttering the
+          // configuration that gets saved back.
         }
-        // Note: (base) fields that do not specify display options are not
-        // tracked in the display at all, in order to avoid cluttering the
-        // configuration that gets saved back.
       }
+
+      // Save elements based on the field name to ensure a consistent order.
+      ksort($this->content);
+      ksort($this->hidden);
+
+      $this->initialized = TRUE;
     }
   }
 
@@ -263,6 +277,7 @@ public function createCopy($mode) {
    * {@inheritdoc}
    */
   public function getComponents() {
+    $this->init();
     return $this->content;
   }
 
@@ -270,6 +285,7 @@ public function getComponents() {
    * {@inheritdoc}
    */
   public function getComponent($name) {
+    $this->init();
     return isset($this->content[$name]) ? $this->content[$name] : NULL;
   }
 
@@ -277,6 +293,8 @@ public function getComponent($name) {
    * {@inheritdoc}
    */
   public function setComponent($name, array $options = array()) {
+    $this->init();
+
     // If no weight specified, make sure the field sinks at the bottom.
     if (!isset($options['weight'])) {
       $max = $this->getHighestWeight();
@@ -299,6 +317,8 @@ public function setComponent($name, array $options = array()) {
    * {@inheritdoc}
    */
   public function removeComponent($name) {
+    $this->init();
+
     $this->hidden[$name] = TRUE;
     unset($this->content[$name]);
     unset($this->plugins[$name]);
@@ -310,6 +330,8 @@ public function removeComponent($name) {
    * {@inheritdoc}
    */
   public function getHighestWeight() {
+    $this->init();
+
     $weights = array();
 
     // Collect weights for the components in the display.
