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.
Issue fork display_builder-3630489
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
Comment #4
mogtofu33 commentedComment #6
pdureau commented