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

Perf Fix : AddWithResize(T) #1129

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

ElizabethOkerio
Copy link
Contributor

@ElizabethOkerio ElizabethOkerio commented Dec 6, 2023

The CreateStructuralPropertyBag method begins by initializing an empty list of properties. It then iterates through the structural and computed properties in a resource, appending them to the empty list. Currently, the frequent invocation of the AddWithResize(T) method appears to be resource-intensive. To mitigate this, preallocating a list with a specific size helps minimize this expense.

CPU Usage before these changes
addwithresize1

CPU usage after these changes:
addwithresize

@ElizabethOkerio ElizabethOkerio merged commit df2640c into OData:main Dec 8, 2023
2 checks passed
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.

4 participants