consumerfinance.gov
consumerfinance.gov copied to clipboard
Speed up initial render and hydration of pfc grad path
Closes https://github.com/cfpb/consumerfinance.gov/issues/8219
This PR does two things:
- Adds and utilizes some bulk updating methods to prevent unnecessary recalculations (primarily in the financial model). Recalculations in the models only happen after all the data has been seeded from the params.
- Checks the radio buttons on the landing page directly instead of emitting clicks (which then trigger a bunch of unneeded/unnecessary events and processing logic)/
Testing
- Visit prod in one window. It will be very slow to both initially load and then to populate the radio buttons (5-15s for each)
- Pull, build, fire up localhost and visit localhost:8000. Loading should be much faster, as should populating the radio buttons. (1-2s)