Skip to content

261 slow multirun performance after database setup with simpathstart#267

Merged
dav-sonn merged 3 commits intodevelopfrom
261-slow-multirun-performance-after-database-setup-with-simpathstart
Oct 13, 2025
Merged

261 slow multirun performance after database setup with simpathstart#267
dav-sonn merged 3 commits intodevelopfrom
261-slow-multirun-performance-after-database-setup-with-simpathstart

Conversation

@andrewbaxter439
Copy link
Copy Markdown
Collaborator

What

  • changes the reloading of persistent data by calling lazily
  • Old process: load each persist table -> join households -> join benefitUnits -> join persons -> then filter for year/country/pop
  • New process: load persist table, check for year country pop. If present, Then (lazy) load households and return

Why

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Optimizes persistent data loading performance by implementing lazy loading for households and changing the database query strategy to reduce unnecessary data fetching. The changes eliminate loading all related households and nested entities upfront, instead only loading them when a matching persistent table is confirmed to exist.

  • Changed households fetch strategy from EAGER to LAZY with SUBSELECT mode
  • Split database query into two phases: first check for existence, then lazily load households if found
  • Removed unnecessary JOIN operations from initial query to reduce database load

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
SimPathsModel.java Modified getProcessed method to use two-phase lazy loading approach
Processed.java Changed households fetch type from EAGER to LAZY with SUBSELECT optimization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dav-sonn
Copy link
Copy Markdown
Collaborator

Everything works smoothly on my machine. The branch can be merged into develop.

@Mariia-Var
Copy link
Copy Markdown
Collaborator

Hi Andy,

I tested the model with the different start years - everything works well (no more slow loading of the initial populations).
I agree with David - the new changes can be pushed into the develop branch.

@dav-sonn dav-sonn merged commit 3bac3a9 into develop Oct 13, 2025
5 checks passed
@andrewbaxter439 andrewbaxter439 deleted the 261-slow-multirun-performance-after-database-setup-with-simpathstart branch January 6, 2026 10:35
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.

4 participants