Performance optimization: Unify the event and process initialization layer

Issue information

From user: mxh

Related to !389 (merged)

Contribution record

Fork management

Problem/Motivation

Follow-up from #3277468: Performance optimization: dynamic event subscription:

We now have 3 initialization layers:

  1. The event subscriber that reads from state
  2. The ECA entity storage that reads from cache (EcaStorage::$configByEvents)
  3. The processor service that loads all event objects from an ECA config: foreach ($eca->getUsedEvents() as $ecaEvent) {

Think this initialization process can be further optimized. For example, it may be considered to just put in all initialization-relevant values into one array and put it into state. That might reduce some I/O (point 1 and 2) and object instantiation overhead (point 3).

Drupal's state service is already using a static in-memory cache once a value got loaded. That means that we can already make use of that service's caching here.

This optimization will include some heavy changes, also on the processor, which needs to be thoroughly tested.

When addressing this, it can be validated whether we can reduce the event's complexity regards its mostly redundant logic that is put in to the applies and appliesForLazyLoadingWildcard method. If done right, we only need one method.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information