Fix measure not using the last reported mark with a given name#43703
Closed
rubennorte wants to merge 3 commits into
Closed
Fix measure not using the last reported mark with a given name#43703rubennorte wants to merge 3 commits into
rubennorte wants to merge 3 commits into
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D55477743 |
…cebook#43705) Summary: Changelog: [internal] Differential Revision: D55477744
…RNTester (facebook#43704) Summary: Changelog: [internal] Adding examples of the rest of APIs in `Performance`/`PerformanceObserver` starting with marks and measures. Differential Revision: D55477746
…ook#43703) Summary: Changelog: [internal] (internal because this API isn't available in OSS yet) I found a bug in the current implementation of `performance.measure` where the API would use the first `mark` reported under a specific name instead of the last one (found it in the new example in RNTester in D55477746 that re-logs the marks every time we click on a button). The root cause for this problem is that we were using `insert` from `std::unordered_set` to update the value, but `insert` doesn't modify the value if it's already present. This fixes the issue by doing a lookup and removing the value prior to inserting it. Differential Revision: D55477743
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Mar 28, 2024
…ame (facebook#43703) Summary: Changelog: [internal] (internal because this API isn't available in OSS yet) I found a bug in the current implementation of `performance.measure` where the API would use the first `mark` reported under a specific name instead of the last one (found it in the new example in RNTester in D55477746 that re-logs the marks every time we click on a button). The root cause for this problem is that we were using `insert` from `std::unordered_set` to update the value, but `insert` doesn't modify the value if it's already present. This fixes the issue by doing a lookup and removing the value prior to inserting it. Differential Revision: D55477743
28b992e to
1e3d876
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D55477743 |
Base commit: 4841373 |
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Mar 28, 2024
…ame (facebook#43703) Summary: Changelog: [internal] (internal because this API isn't available in OSS yet) I found a bug in the current implementation of `performance.measure` where the API would use the first `mark` reported under a specific name instead of the last one (found it in the new example in RNTester in D55477746 that re-logs the marks every time we click on a button). The root cause for this problem is that we were using `insert` from `std::unordered_set` to update the value, but `insert` doesn't modify the value if it's already present. This fixes the issue by doing a lookup and removing the value prior to inserting it. Differential Revision: D55477743
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Apr 2, 2024
…ame (facebook#43703) Summary: Changelog: [internal] (internal because this API isn't available in OSS yet) I found a bug in the current implementation of `performance.measure` where the API would use the first `mark` reported under a specific name instead of the last one (found it in the new example in RNTester in D55477746 that re-logs the marks every time we click on a button). The root cause for this problem is that we were using `insert` from `std::unordered_set` to update the value, but `insert` doesn't modify the value if it's already present. This fixes the issue by doing a lookup and removing the value prior to inserting it. Reviewed By: rshest Differential Revision: D55477743
Contributor
|
This pull request has been merged in 2059894. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Changelog: [internal]
(internal because this API isn't available in OSS yet)
I found a bug in the current implementation of
performance.measurewhere the API would use the firstmarkreported under a specific name instead of the last one (found it in the new example in RNTester in D55477746 that re-logs the marks every time we click on a button).The root cause for this problem is that we were using
insertfromstd::unordered_setto update the value, butinsertdoesn't modify the value if it's already present.This fixes the issue by doing a lookup and removing the value prior to inserting it.
Differential Revision: D55477743