Skip to content

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Aug 13, 2025

Not yet complete.

On a scenario using 10k tests in a test class, I see:

image

TestContextImplementation constructor receives already an IDictionary<string, object?>. However, we clone the dictionary to add 4 more properties to it, without affecting the original dictionary. This causes many allocations. The approach I'm taking here is to create our own dictionary type, which tracks the four extra values we need + the original dictionary. Then, only if the user attempts to mutate the original dictionary, we clone.

@Youssef1313 Youssef1313 marked this pull request as draft August 13, 2025 12:12
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.

1 participant