Consider registration validation performance impact

Created on 6 January 2025, 3 days ago

Problem/Motivation

Working on 📌 Replace HostEntity::isEnabledForRegistration Active and src/Plugin/Block/RegistrationStatus.php we identified that:

We call $host_entity->isAvailableForRegistration() 3 times in various places of the code of this block. When rendering the block we therefore call it 3 times. Which means the registration validation event is going to be fired 3 times on that request by this block alone.

it's registered as a callback. For an enabled block it is called once, and then a second time that I added. In theory I think what you are suggesting is correct, but in reality it seems the constructor is getting called more often than the build function, at least in a debugging session. Let's leave as is for now and address in a performance follow up. We may want to cache inside the host entity, if we can do that safely.

In theory we should be able to use a memory cache to safely cache validation results at the level of the validator.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

3.3

Component

Registration Core

Created by

🇬🇧United Kingdom jonathanshaw Stroud, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024