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

Avoid unnecessary std::shared_ptr copies #4212

Merged

Conversation

chriche-ms
Copy link
Member

@chriche-ms chriche-ms commented Jun 23, 2020

Related Issue

Resolves #4211

Description

This PR updates various frequently called functions in order to minimize the frequency with which ownership of various std::shared_ptr variables is shared. Instead the variables are either passed by reference (instead of by value) or ownership is transferred using std::move.

How Verified

Existing unit tests were successfully run.

Microsoft Reviewers: Open in CodeFlow

@chriche-ms chriche-ms changed the title Chriche/uwp performance sharedmodel Avoid unnecessary std::shared_ptr copies Jun 23, 2020
@chriche-ms chriche-ms self-assigned this Jun 24, 2020
@shalinijoshi19 shalinijoshi19 added the Area-Performance Tracking issues around perf/renderer latency etc label Jun 24, 2020
@shalinijoshi19
Copy link
Member

@almedina-ms is added to the review. #Closed

@shalinijoshi19
Copy link
Member

@paulcam206 is added to the review. #Closed

@shalinijoshi19
Copy link
Member

@RebeccaAnne is added to the review. #Closed

@ghost ghost added the no-recent-activity label Jun 29, 2020
@ghost ghost assigned almedina-ms Jun 29, 2020
@ghost
Copy link

ghost commented Jun 29, 2020

Hi @chriche-ms. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@ghost ghost removed the no-recent-activity label Jun 30, 2020
@ghost
Copy link

ghost commented Jun 30, 2020

Hi @chriche-ms; Thanks for taking action on your previously stale pull request. Resetting staleness.

@ghost ghost added the no-recent-activity label Jul 7, 2020
@ghost
Copy link

ghost commented Jul 7, 2020

Hi @chriche-ms. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along.

@ghost ghost removed the no-recent-activity label Jul 7, 2020
@ghost
Copy link

ghost commented Jul 7, 2020

Hi @paulcam206; Thanks for reviewing this previously stale pull request. Resetting staleness. @chriche-ms FYI.

@chriche-ms chriche-ms merged commit 9a8ff33 into microsoft:main Jul 8, 2020
@chriche-ms chriche-ms deleted the chriche/uwp_performance_sharedmodel branch July 8, 2020 12:03
rankush pushed a commit to rankush/AdaptiveCards that referenced this pull request May 8, 2024
* Change std::shared_ptr parameters to be const-ref, rather than by value, to avoid unnecessary reference count changes.

* Update GetSharedModel and related function to minimize shared_ptr ownership changes

* Update Java interop code

Co-authored-by: shalinijoshi19 <shalinij@microsoft.com>
Co-authored-by: Paul Campbell <paulcam@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Performance Tracking issues around perf/renderer latency etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UWP] Avoid unnecessary std::shared_ptr ownership changes
4 participants