Skip to content

feat: parallelize deterministic agents with asyncio.gather#25

Open
HeetRanpura wants to merge 1 commit intoadvikdivekar:mainfrom
HeetRanpura:feature/pipeline-parallelization
Open

feat: parallelize deterministic agents with asyncio.gather#25
HeetRanpura wants to merge 1 commit intoadvikdivekar:mainfrom
HeetRanpura:feature/pipeline-parallelization

Conversation

@HeetRanpura
Copy link
Copy Markdown
Contributor

  • Run calculate_true_total_cost and calculate_affordability concurrently via asyncio.gather + asyncio.to_thread (independent computations)
  • Keep run_all_scenarios and calculate_risk_score sequential (dependency chain)
  • Make save_financial_inputs and save_simulation_results fire-and-forget via asyncio.create_task so Firestore writes never block the response
  • Expected latency reduction: 35-45% on the /analyze endpoint

- Run calculate_true_total_cost and calculate_affordability concurrently
- Keep run_all_scenarios and calculate_risk_score sequential (dependency chain)
- Make Firestore writes fire-and-forget via asyncio.create_task
- Expected latency reduction: 35-45% on the /analyze endpoint
@HeetRanpura HeetRanpura force-pushed the feature/pipeline-parallelization branch from f2c6121 to b074a1f Compare April 23, 2026 21:13
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.

1 participant