Skip to content

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented May 19, 2025

Summary:

Changelog: [Internal]

There are multiple changes:

  1. PerformanceTracer class, TraceEvent struct are moved to tracing namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
  2. Added Timing.h class which defines timing primitives for the Tracing domain. These are compliant with CDP requirements: microseconds granularity and all events inside one profile has to have a common time origin. In order to guarantee this, we are introducing these primitives, std::chrono::steady_clock::epoch was selected as the time origin. Tracing as a subsystem is responsible for receiving timestamps from multiple sources and then converting them to this common abstraction.
  3. PerformanceTracer will receive timestamps for Performance Web API entries in domain-specific abstractions. Right now this is DOMHighResTimeStamp, which is an alias for double, but which will be replaced by HighResTimeStamp in one of the diffs at the top of the stack.

Differential Revision: D74892330

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 19, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74892330

@hoxyq hoxyq force-pushed the export-D74892330 branch from 560a6f9 to c6bfe16 Compare May 20, 2025 17:29
hoxyq added a commit to hoxyq/react-native that referenced this pull request May 20, 2025
Summary:

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Differential Revision: D74892330
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74892330

hoxyq added a commit to hoxyq/react-native that referenced this pull request May 20, 2025
Summary:
Pull Request resolved: facebook#51454

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Differential Revision: D74892330
hoxyq added a commit to hoxyq/react-native that referenced this pull request May 20, 2025
Summary:
Pull Request resolved: facebook#51454

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Differential Revision: D74892330
hoxyq added a commit to hoxyq/react-native that referenced this pull request May 20, 2025
Summary:

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Differential Revision: D74892330
@hoxyq hoxyq force-pushed the export-D74892330 branch from c6bfe16 to b38f7f1 Compare May 20, 2025 17:51
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74892330

hoxyq added a commit to hoxyq/react-native that referenced this pull request May 20, 2025
Summary:
Pull Request resolved: facebook#51454

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Differential Revision: D74892330
@hoxyq hoxyq force-pushed the export-D74892330 branch from b38f7f1 to 5581f7a Compare May 20, 2025 17:56
hoxyq added a commit to hoxyq/react-native that referenced this pull request May 20, 2025
Summary:
Pull Request resolved: facebook#51454

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Differential Revision: D74892330
…onverters (facebook#51455)

Summary:
Pull Request resolved: facebook#51455

# Changelog: [Internal]

The main idea is that subsystems who might use a different time origin (the starting point of the whole timeline of events), can use `toChronoSteadyClockTimePoint` method to get raw `std::chrono::steady_clock::time_point` and then offset it by some arbitrary epoch: be it unix time origin or `std::chrono::steady_clock::epoch`.

`fromChronoSteadyClockTimePoint` can be used to convert time stamps from external systems, like Hermes.

Differential Revision: D74892329
hoxyq added a commit to hoxyq/react-native that referenced this pull request May 21, 2025
Summary:

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Reviewed By: rubennorte

Differential Revision: D74892330
@hoxyq hoxyq force-pushed the export-D74892330 branch from 5581f7a to 5402de6 Compare May 21, 2025 13:04
Summary:
Pull Request resolved: facebook#51454

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Reviewed By: rubennorte

Differential Revision: D74892330
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74892330

@hoxyq hoxyq force-pushed the export-D74892330 branch from 5402de6 to a0d3a18 Compare May 21, 2025 13:07
hoxyq added a commit to hoxyq/react-native that referenced this pull request May 21, 2025
Summary:
Pull Request resolved: facebook#51454

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Differential Revision: D74892330
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 21, 2025
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 0ec36c4.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 5489e18.

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. p: Facebook Partner: Facebook Partner Reverted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants