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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | config_split-lazy-load-black-gray-lists.patch | 2.45 KB | naiuto |
Comments
Comment #2
naiuto commentedComment #3
bircherthe test bot will fail on unit tests without invoking the new methods
Comment #6
bircherThanks for your contribution!
I fixed the tests.