 When the format on disk changes, this value is changed, so that
 straight.el knows to regenerate the whole cache.")
 
+(defvar straight--build-cache-text nil
+  "Literal text of the build cache.
+If this is unchanged between loading and saving the build cache,
+then the saving step is skipped for efficiency.")
+
 (defun straight--load-build-cache ()
   "Load data from build-cache.el into memory.
 This sets the variables `straight--build-cache',

        ;; Otherwise, we can load from disk.
        (setq straight--build-cache cache)
        (setq straight--eagerly-checked-packages eager-packages)
        (setq straight--live-modified-repos live-repos)))))

(defun straight--save-build-cache ()
  "Write data from memory into build-cache.el.
This uses the values of `straight--build-cache',
`straight--eagerly-checked-packages', and
`straight--live-modified-repos'."
  (with-temp-file (straight--build-cache-file)
    ;; Prevent mangling of the form being printed in the case that
    ;; this function was called by an `eval-expression' invocation of
    ;; `straight-use-package'.

  ;; malformed (or outdated), these values will be use.
  (setq straight--build-cache (make-hash-table :test #'equal))
  (setq straight--eagerly-checked-packages nil)
  (setq straight--live-modified-repos nil)
  (setq straight--build-cache-text nil)
  (ignore-errors
    (with-temp-buffer
      ;; Using `insert-file-contents-literally' avoids
