AiProviderClientBase::getApiDefinition performance concerns

Created on 31 October 2024, about 2 months ago

Problem/Motivation

AiProviderClientBase::getApiDefinition is called in the client constructor and sets a property. This loads a file from disk and parses it's YAML. That's an expensive operation to perform multiple times.

On top of that, \Drupal\ai\Base\AiProviderClientBase::getAvailableConfiguration calls the method even though the property is available.

Proposed resolution

Use some kind of caching for the definition so we're not hitting disk I/O and spending CPU time parsing YAML over and over.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

AI Core module

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024