Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loans: Optimize portfolio computation removing a read DB access #1374

Merged
merged 2 commits into from
May 29, 2023

Conversation

lemunozm
Copy link
Contributor

Description

We do not really need to read the portfolio to compute a new iteration over it. All required values come from outside.

@lemunozm lemunozm added Q1-easy Can be done by primarily duplicating and adapting code. D0-ready Pull request can be merged without special precaution and notification. I7-optimisation Enhancement that provides better perfromance or smaller footprint. P4-required Issue should be addressed labels May 29, 2023
@lemunozm lemunozm self-assigned this May 29, 2023
Copy link
Contributor

@hieronx hieronx left a comment

Choose a reason for hiding this comment

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

Nice optimization 👍

pallets/loans-ref/src/types/portfolio.rs Outdated Show resolved Hide resolved
pallets/loans-ref/src/types/portfolio.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@hieronx hieronx left a comment

Choose a reason for hiding this comment

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

LGTM!

@lemunozm lemunozm force-pushed the loans/portfolio-optimization branch from 85b0662 to 5811c92 Compare May 29, 2023 14:12
@lemunozm lemunozm enabled auto-merge (squash) May 29, 2023 14:12
@lemunozm
Copy link
Contributor Author

Rebased

@lemunozm lemunozm requested a review from hieronx May 29, 2023 14:13
@lemunozm lemunozm merged commit b2669f7 into main May 29, 2023
11 checks passed
@lemunozm lemunozm deleted the loans/portfolio-optimization branch May 29, 2023 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D0-ready Pull request can be merged without special precaution and notification. I7-optimisation Enhancement that provides better perfromance or smaller footprint. P4-required Issue should be addressed Q1-easy Can be done by primarily duplicating and adapting code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants