in #2161591: Change default active config from file storage to DB storage we're discussing replacing the active store with a queryable key value based store. Whilst reviewing the relevant code I realised we could swap out calls to Drupal::config()->get() with a call to ConfigFactory::readMultiple().

This should help us leverages the static cache in ConfigFactory better.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Status: Active » Needs review
Related issues: +#2161591: Change default active config from file storage to DB storage
FileSize
4.62 KB

Here's a patch.

alexpott’s picture

Issue summary: View changes
alexpott’s picture

Issue summary: View changes
FileSize
703 bytes
4.47 KB

Ok. reading the code realised that the patch in #1 would break count queries on empty result sets.

alexpott’s picture

FileSize
4.47 KB

A dot free patch

Anonymous’s picture

looks good to me. alexpott++

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

To me as well.

It's not as much about the static cache but the persistent cache in the cached storage controller, a getMultiple() is a single getMultiple() on the cache backend, which is more efficient.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Nice catch!

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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