Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We read all the configuration data in StorageComparer and statically cache in that object. This means that any events and the importer have to reread the configuration.
Proposed resolution
We can wrap the source and target storages with CachedStorage
so that we don't have to re-read the data.
Remaining tasks
Review
Commit
User interface changes
None
API changes
None
Beta phase evaluation
Issue category | Task because it not fixing a bug - just a small internal refactor of StorageComparer |
---|---|
Issue priority | Major because during configuration import we read a lot of data from disk and the db anything we can do to minimise the amount of times we have to read from disk or the db is a good thing. Additionally as we add configuration import validators they will need to interact with incoming data - we shouldn't be reading everything twice. |
Prioritized changes | The main goal of this issue is performance. |
Disruption | none |
Comment | File | Size | Author |
---|---|---|---|
#16 | 2411689.16.patch | 6.59 KB | alexpott |
#14 | 2411689.14.patch | 6.59 KB | alexpott |
#5 | 2411689.5.patch | 7.04 KB | alexpott |
#5 | 1-5-interdiff.txt | 2.06 KB | alexpott |
#1 | 2411689.1.patch | 6.91 KB | alexpott |
Comments
Comment #1
alexpottHere's a patch.
Comment #2
alexpottComment #3
alexpottComment #4
Wim LeersIs "statically" still correct technically speaking?
s/Wrapper/Wrap/
:)
Unchanged logic compared to HEAD, which is good. But: why not use strict comparison, while refactoring this already?
How does this prime the memory-backend-backed cached storages? AFAICT it just assigns them to local variables.
Comment #5
alexpottComment #6
alexpottDone some profiling on top of the patch in #2416109: Validate configuration dependencies before importing configuration. The profile is for running ConfigImporter::initialize() when importing the standard profile over the minimal profile - so there is a tonne of configuration to validate. The results are available here: https://blackfire.io/profiles/compare/4b09cf95-469d-40d5-9767-bb3e87b697...
tldr; This patch represents a significant performance boost. The amount of time spent is almost 50% less and we are talking over 1 second saved.
Comment #7
Wim Leers#6: awesome!
#5.1: wouldn't it be more accurate and less confusing to not say "static caching" but "cache in memory"?
Comment #8
Wim LeersMy remark about #6.1 is probably just because I'm a native speaker — @alexpott says that to him "static caching" and "caching in memory" are the same thing.
Comment #9
alexpottComment #11
catchCommitted/pushed to 8.0.x, thanks!
Comment #12
tstoecklerSeems like only half of the patch was committed?
Comment #14
alexpottThe missing part... weird.
Comment #16
alexpottFixing the patch.
Comment #19
alexpottAs per the original rtbc...
Comment #20
xjmConfirmed that this is indeed the missing bit of the patch by comparing with a rebase from before the previous commit. Committed and pushed to 8.0.x., thanks!