Skip to content

Slow ReFrame initialization when using external references #3754

Todo

Description

@victorusu

Problem description

ReFrame startup times increase substantially when external references are used across a large number of tests, particularly when the external reference file contains a large number of entries.

The overhead appears to be associated with evaluating external references during the initialization phase. This can significantly increase the time required to discover and load tests, even when the external reference data is not immediately needed.

Steps to reproduce

  1. Add external references to a large number of tests, following the [External References documentation](https://reframe-hpc.readthedocs.io/en/stable/howto.html#external-references).

  2. Create a large external reference file containing many entries.

  3. Run ReFrame with the following command:

    reframe -c <your-tests-folder> -R -lC
  4. Observe the time required for ReFrame to complete initialization and list the tests.

Proposed improvement

One possible approach to mitigate this overhead would be to defer external reference evaluation until the performance stage, rather than evaluating all references during initialization.

This would not eliminate the evaluation cost, but it would move it away from the initialization phase, reducing the time required for test discovery and loading.

Additionally, the evaluation results should be cached so that each external reference is evaluated only once and subsequent accesses reuse the cached result. This would prevent the evaluation overhead from being incurred repeatedly during performance evaluation.

Expected benefits

  • Reduced ReFrame initialization time when working with large external reference files.
  • Avoid unnecessary evaluation of external references during test discovery and loading.
  • Avoid repeated evaluation of the same references through caching.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions