Skip to content

NFR: Bundle Loading Performance (Monolithic _bundle.py) #148

@dschwartznyc

Description

@dschwartznyc

Problem Description:

The current architecture generates all model types (classes, enums, functions) into a single _bundle.py file. For large models like the Common Domain Model (CDM), this results in a monolithic module that must be fully parsed and executed by Python upon any import. This causes significant startup latency and high memory overhead even when only a small subset of the model is needed.

Steps to Reproduce:

  1. Generate the full CDM using the Python generator.
  2. Attempt to import any type from the model (e.g., from cdm.base.datetime.AdjustableDate import AdjustableDate).
  3. Measure the time spent in the import statement and peak memory usage.

Expected Result:

The model should support granular or lazy loading, allowing sub-packages to be imported independently without parsing the entire universe of types.

Actual Result:

Every import triggers the execution of the entire _bundle.py, leading to multi-second delays for large models.

Additional Context:

Resolving this is functionally blocked by the Circular Dependencies issue.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions