-
Notifications
You must be signed in to change notification settings - Fork 25k
Use in performance.measure #54337
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
Closed
Closed
Use in performance.measure #54337
Conversation
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
b3d1a5e to
3dbe8aa
Compare
hoxyq
added a commit
to hoxyq/react-native
that referenced
this pull request
Oct 31, 2025
Summary: # Changelog: [Internal] The approach is identical to `console.timeStamp()`, see the diff below for more context. In this diff, we apply this approach to `performance.measure()`. Differential Revision: D85481863
hoxyq
added a commit
to hoxyq/react-native
that referenced
this pull request
Oct 31, 2025
Summary: # Changelog: [Internal] The approach is identical to `console.timeStamp()`, see the diff below for more context. In this diff, we apply this approach to `performance.measure()`. Differential Revision: D85481863
af511f7 to
93d82c0
Compare
hoxyq
added a commit
to hoxyq/react-native
that referenced
this pull request
Nov 3, 2025
Summary: # Changelog: [Internal] The approach is identical to `console.timeStamp()`, see the diff below for more context. In this diff, we apply this approach to `performance.measure()`. Reviewed By: huntie Differential Revision: D85481863
93d82c0 to
c2c8133
Compare
hoxyq
added a commit
to hoxyq/react-native
that referenced
this pull request
Nov 5, 2025
Summary: # Changelog: [Internal] The approach is identical to `console.timeStamp()`, see the diff below for more context. In this diff, we apply this approach to `performance.measure()`. Reviewed By: huntie Differential Revision: D85481863
Summary: # Changelog: [Internal] This is not used, nor required. The controller is the canonical way of using targets. Reviewed By: huntie Differential Revision: D85440639
…k#54282) Summary: # Changelog: [Internal] It is already in a tracing session state, we are going to use it in RuntimeTarget. Reviewed By: huntie Differential Revision: D85440638
Summary: # Changelog: [Internal] This will control scenarios when we enable `console.createTask` implementation, and when we just use the stub version. Reviewed By: huntie Differential Revision: D85440641
Summary: # Changelog: [Internal] This defines the main entities for the console.createTask(): - ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks. - ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript. - ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`. I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example. Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces. Reviewed By: sbuggay Differential Revision: D85481864
Summary: # Changelog: [Internal] Adds a basic implementation of the `console.createTask()` method. When this method is called, the `ConsoleTaskContext` is allocated. When `task.run()` is called, the corresponding `ConsoleTask` that has a pointer to `ConsoleTaskContext` will push it onto the stack in `ConsoleTaskOrchestrator`. Also adds types to corresponding Flow declarations. Reviewed By: sbuggay Differential Revision: D85481865
Summary: # Changelog: [Internal] I couldn't add it to the previous diff, since console.createTask is not present on the base revision. See [1]. Reviewed By: sbuggay Differential Revision: D85860982
Summary: # Changelog: [Internal] Adds a benchmark that is scoped to JSX scenario. React uses createTask() on JSX instances to preserve owner stacks relationship, and so users can see tree-like stacks in the debugger. Since this only happens in DEV, I have to force dev mode in Fantom as well. Reviewed By: sbuggay Differential Revision: D85860981
Summary: # Changelog: [Internal] Actually gate the task scheduling logic, so that the implementation is a no-op by default, if we are not tracing in the background or have Runtime CDP domain enabled. The drawback is that we might loose stack traces for some component renders, if the corresponding JSX declaration was called before we've enabled the `console.createTask()`. Reviewed By: huntie Differential Revision: D85849862
Summary: # Changelog: [Internal] Whenever the `console.timeStamp()` is called and we are actually tracing, we will peek at the `ConsoleTaskOrchestrator` stack and check if there is a task. If so, it means that this call happened inside a task context, so we can request a stack trace and propagate it down to `PerformanceTracer`. Reviewed By: huntie Differential Revision: D85481866
Summary: # Changelog: [Internal] The approach is identical to `console.timeStamp()`, see the diff below for more context. In this diff, we apply this approach to `performance.measure()`. Reviewed By: huntie Differential Revision: D85481863
c2c8133 to
b622b31
Compare
|
This pull request has been merged in 7722eae. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
This PR has been merged.
meta-exported
p: Facebook
Partner: Facebook
Partner
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]
The approach is identical to
console.timeStamp(), see the diff below for more context.In this diff, we apply this approach to
performance.measure().Differential Revision: D85481863