Problem/Motivation

Each change in the builder saves the instance, and saving invalidates the persistent cache of all its revisions. The history buttons then load the whole past, through getPast() three times per build and trimPast() after the save, and core writes every loaded revision back to the entity cache. So every change rewrites up to 20 full revisions, sources included, to be read at most once before the next change drops them again. Profiled on a style change, that write was the largest single cost of the request: removing it took the controller from 212 to 50 ms.

Proposed resolution

InstanceStorage overrides getFromPersistentRevisionCache() to return nothing and setPersistentRevisionCache() to store nothing. Revisions still load from the database, and the memory cache still serves repeated loads within a request. The current revision keeps its persistent cache.

Remaining tasks

  • Review.

User interface changes

None.

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

  • mogtofu33 committed 3dab725f on 1.0.x
    task: #3630489 Instance history rewrites every revision to the entity...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)