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 deployment performance when there are many components. #486

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

zagy
Copy link
Member

@zagy zagy commented Nov 18, 2024

Improves the performance of Component.__init__ which is called very often.

@elikoga I'm not sure if this is tested enough. No tests break, so I would assume the functionality is the same, but please have a look.

@zagy zagy requested a review from elikoga November 18, 2024 08:47
@zagy zagy self-assigned this Nov 18, 2024
Improves the performance of `Component.__init__` which is called very often.
@zagy zagy force-pushed the improve-component_init_performance branch from b1b969f to f60e79b Compare November 18, 2024 10:39
@elikoga
Copy link
Member

elikoga commented Nov 18, 2024

This code path is tested in

def test_unused_components_get_reported(sample_service, output):
e = Environment("test-unused")
e.load()
output.backend.output = ""
e.configure()
assert "'Unused': BadUnused" in output.backend.output
although the assertion only asserts a small part of the output breadcrumbs

@zagy
Copy link
Member Author

zagy commented Nov 18, 2024

This code path is tested in

def test_unused_components_get_reported(sample_service, output):
e = Environment("test-unused")
e.load()
output.backend.output = ""
e.configure()
assert "'Unused': BadUnused" in output.backend.output

although the assertion only asserts a small part of the output breadcrumbs

Okay, I verified that this test breaks if I remove the updated code :)

@zagy zagy requested review from ctheune and removed request for elikoga November 18, 2024 14:35
@zagy zagy merged commit 81db2f8 into main Nov 20, 2024
15 checks passed
@zagy zagy deleted the improve-component_init_performance branch November 20, 2024 09:09
Copy link
Member

@ctheune ctheune left a comment

Choose a reason for hiding this comment

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

Sounds good. Initially I was even thinking whether we could delay the computation of the init_breadcrumbs to a later point in time and just do the _getframe(2) call.

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.

3 participants