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

rename_accounts: Copy only renamed directives for performance #18

Merged
merged 3 commits into from
Aug 23, 2022

Conversation

ankurdave
Copy link
Contributor

@ankurdave ankurdave commented Aug 23, 2022

#17 caused the rename_accounts plugin to copy all postings within all transactions, even if they were not renamed. This harmed performance. On my ledger with 10,000 transactions, with a rename that affects 8 postings, it increased the runtime from 15.2 ms to 133.9 ms.

This PR fixes the performance regression by copying postings and entries only if they were renamed. This brings the runtime back down to 16.0 ms.

This warning seems difficult to fix without an invasive refactoring.
This may give us more flexibility to modify the object in place if desired.
@redstreet redstreet merged commit ede7830 into redstreet:main Aug 23, 2022
@redstreet
Copy link
Owner

Terrific. Thank you for the clear code and for the performance numbers!

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.

2 participants