Skip to content

Issue 10 composer performance - #1149

Open
dereck-symmetry wants to merge 2 commits into
mainfrom
issue-10---Composer-performance
Open

Issue 10 composer performance#1149
dereck-symmetry wants to merge 2 commits into
mainfrom
issue-10---Composer-performance

Conversation

@dereck-symmetry

Copy link
Copy Markdown
Description of Change

Previous (current) composer does the composition of each json fragment as it comes back. This means that the time grows on a quadratic. Specifically, compose_json_with_fragment_list (components/lif/composer/core.py) loops over fragments and calls compose_json_with_single_fragment for each one. That function does
json.loads(lif_record_json) then json.dumps(...) — i.e. a full serialization round-trip of
the entire (growing) record per fragment
.

Fix - compose directly on the dict, one parse / one model-dump at the boundary, zero intermediate
JSON. The public API is unchanged — all four functions keep their signatures and return types.

Closes #10

Type of Change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality
    to not work as expected)
  • Documentation update
  • Infrastructure/deployment change
  • Performance improvement
  • Code refactoring
Project Area(s) Affected
  • bases/
  • components/
  • projects/
  • orchestrators/
  • frontends/
  • deployments/
  • cloudformation/ or sam/ templates
  • reference_data/
  • scripts/
  • test/ or e2e/
  • Database schema (migrations)
  • API endpoints
  • Documentation (docs/, READMEs, ARCHITECTURE.md, CLAUDE.md)
Checklist
  • commit message follows commit guidelines (see commitlint.config.mjs)
  • code passes linting checks (uv run ruff check)
  • code passes formatting checks (uv run ruff format)
  • code passes type checking (uv run ty check)
  • pre-commit hooks have been run successfully
Testing
  • Manual testing performed
  • Automated tests added/updated
  • Integration testing completed
Additional Notes

This change is deceptively small. I worked with Claude until we were able to get the least invasive procedure completed. WE MUST DO EXTENSIVELY end-to-end testing when this change is rolled into main. There shouldn't be any side effects, and I have tested extensively manually and with automated tools.

We should have LLM do additional testing and code verification on this small change after roll into main. There is, though, no suspicions that this will in any way fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Improve Composer Performance

1 participant