Skip to content

perf(core): allow skipping loading experiment catalogs from DB when initializing DiscoverySpace#675

Merged
AlessandroPomponio merged 1 commit intomainfrom
maj_skip_catalog_load_read_only
Mar 9, 2026
Merged

perf(core): allow skipping loading experiment catalogs from DB when initializing DiscoverySpace#675
AlessandroPomponio merged 1 commit intomainfrom
maj_skip_catalog_load_read_only

Conversation

@michael-johnston
Copy link
Copy Markdown
Member

from_configuration unconditionally called experimentCatalog() on every construction of a DiscoverySpace. This method queries the samplestore for any externally registered experiment plugins and loads them into the actuator registry so they are available for replay during an active operation run.

For read-only CLI commands (show requests, show results, show entities) this work is entirely unnecessary: these commands inspect stored measurement data and never resolve or replay experiment references. The catalog load was measured at ~852ms — a full DB query round-trip plus plugin loading overhead — paid on every invocation with no benefit.

The commit adds a boolean load_experiment_catalog parameter to init (default True), from_configuration and from_stored_configuration. from_operation_id, whose callers are exclusively read-only show commands, passes load_experiment_catalog=False, bypassing the experimentCatalog() call and the actuator registry update entirely.

The default remains True so all other construction paths (from_configuration called directly, space creation during an active run) retain the existing behaviour without requiring changes at call sites.

Measured saving on ado show requests / show results / show entities: ~852ms.

…d-only paths

from_configuration unconditionally called experimentCatalog() on every
construction of a DiscoverySpace. This method queries the samplestore for
any externally registered experiment plugins and loads them into the
actuator registry so they are available for replay during an active
operation run.

For read-only CLI commands (show requests, show results, show entities)
this work is entirely unnecessary: these commands inspect stored
measurement data and never resolve or replay experiment references.
The catalog load was measured at ~852ms — a full DB query round-trip
plus plugin loading overhead — paid on every invocation with no benefit.

The commit adds a boolean load_experiment_catalog parameter to __init__ (default True), from_configuration and from_stored_configuration. from_operation_id,
whose callers are exclusively read-only show commands, passes
load_experiment_catalog=False, bypassing the experimentCatalog() call
and the actuator registry update entirely.

The default remains True so all other construction paths (from_configuration
called directly, space creation during an active run) retain the existing
behaviour without requiring changes at call sites.

Measured saving on ado show requests / show results / show entities: ~852ms.
@AlessandroPomponio AlessandroPomponio changed the title perf: add load_experiment_catalog flag to skip catalog loading on read-only paths perf(core): allow skipping loading experiment catalogs from DB when initializing DiscoverySpace Mar 9, 2026
Copy link
Copy Markdown
Member

@AlessandroPomponio AlessandroPomponio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@AlessandroPomponio AlessandroPomponio added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit 272fc81 Mar 9, 2026
19 checks passed
@AlessandroPomponio AlessandroPomponio deleted the maj_skip_catalog_load_read_only branch March 9, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants