My project uses Configuration Split to place over 2500 configuration YML files in multiple module directories. With this in place, I found that most drush commands would take about 30 seconds to execute. I traced it to the calculation of the blacklist and graylist in SplitFilter's constructor:

 
  public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigManagerInterface $manager, StorageInterface $secondary = NULL) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->manager = $manager;
    $this->secondaryStorage = $secondary;
    $this->calculateBlacklist();
    $this->calculateGraylist();
  }

These object members are not needed until used by other methods, so I propose creating two 'get' methods which calculate these lists when needed. This restores drush to normal performance.

Comments

naiuto created an issue. See original summary.

naiuto’s picture

StatusFileSize
new2.45 KB
bircher’s picture

Status: Active » Needs review

the test bot will fail on unit tests without invoking the new methods

Status: Needs review » Needs work

The last submitted patch, 2: config_split-lazy-load-black-gray-lists.patch, failed testing. View results

  • bircher committed 4405f7c on 8.x-1.x
    Issue #3157901 by naiuto, bircher: SplitFilter should not load black/...
bircher’s picture

Status: Needs work » Fixed

Thanks for your contribution!
I fixed the tests.

  • bircher committed 4405f7c on 2.0.x
    Issue #3157901 by naiuto, bircher: SplitFilter should not load black/...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.