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

Improve performance of reusing SectionControllers by creating temporary dictionary #92

Merged
merged 1 commit into from
May 16, 2022

Conversation

nkristek
Copy link
Collaborator

This PR improves the performance of the SectionController reusing logic from O(m * n) to O(m + n).

Previously, for every section in the new list, a section with the same id was searched in the old list, meaning the old list was iterated for every item in the new list. Now this PR creates a temporary dictionary which offers constant time lookups and reduces the effort to one iteration of the old list.

@nkristek nkristek requested a review from HeEAaD May 16, 2022 14:52
@nkristek nkristek self-assigned this May 16, 2022
@nkristek nkristek merged commit 12aa093 into develop May 16, 2022
@nkristek nkristek deleted the improve_sectioncontroller_reusing branch May 16, 2022 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants