Skip to content

Remove unnecessary context allocation#952

Open
vinistock wants to merge 1 commit into
vs_avoid_duplicate_namespace_lookupfrom
vs_remove_unnecessary_context_allocation
Open

Remove unnecessary context allocation#952
vinistock wants to merge 1 commit into
vs_avoid_duplicate_namespace_lookupfrom
vs_remove_unnecessary_context_allocation

Conversation

@vinistock

Copy link
Copy Markdown
Member

Currently, we are allocating a new LinearizationContext each time for ancestors_of. This is completely unnecessary because the linearization recursion already cleans up the context object.

We can simply reuse the same object stored in the Resolver, avoid the allocation entirely and remove ancestors_of while we're at it. This provides a 12% speed up for resolution, bringing us to ~11s.

@vinistock vinistock self-assigned this Jul 23, 2026
@vinistock
vinistock requested a review from a team as a code owner July 23, 2026 14:09
@vinistock vinistock added the enhancement New feature or request label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant