Problem/Motivation

The problem is already very eloquently explained in #3217783: Configuration management performance regression - slow config:import.

Most config imports and most config exports (at least during development) change relatively little amount of config relative to the total amount of config on a site. So to always wipe the transformation storage is not the most efficient.

Steps to reproduce

Open the config import page or run drush config:status

Proposed resolution

Make the StorageCopyTrait smarter by using the StorageComparer when it makes sense.
A new method is added to the trait to override the mechanism choice.

Remaining tasks

Find out the best criteria for when to use the StorageComparer.

User interface changes

none

API changes

A new method on the StorageCopyTrait which can be overwritten to decide when to use the StorageComparer.

Data model changes

none

Release notes snippet

StorageCopyTrait uses StorageComparer to improve performance in some cases.

Issue fork drupal-3223976

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bircher created an issue. See original summary.

bircher’s picture

Status: Active » Needs review
bircher’s picture

We should also credit @tstoeckler since the code for updating with the StorageComparer was inspired by his modules tests.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bircher’s picture

Status: Needs review » Closed (outdated)

I think this is probably over engineering things. #3232494: Optimise StorageCopyTrait for slow write operations already makes sure not to change more than necessary.