Commit Graph

3 Commits

Author SHA1 Message Date
Ruslan Shestopalyuk 62a28e4bdb Native side implementation for Performance.measure()
Summary:
Changelog: [Internal]

This implements the C++ side logic of handling `Performance.measure` calls.

Since measures may refer to earlier logged marks by name, we need to keep track of the former. I also use a fixed size (circular) buffer to prevent the marks from piling forever.

Also adds implementation of clearing marks/measures, as per standard.

Reviewed By: mdvacca

Differential Revision: D41756928

fbshipit-source-id: 19dce28d6af4c5646274e6d5db20b41869282780
2022-12-06 17:34:24 -08:00
Ruslan Shestopalyuk d8bcab2be7 Implement Performance.measure support for RN (JS side)
Summary:
Changelog: [Internal]

This adds JS side implementation (including the API) for the `Performance.measure` functionality, [as described in the corresponding standard](https://www.w3.org/TR/user-timing/#measure-method).

The JS part is separated from the C++ implementation (further down the stack) to help the review being more focused.

Reviewed By: mdvacca

Differential Revision: D41733190

fbshipit-source-id: 72b69f6bb332aed4b9477a186b0e818b62009220
2022-12-06 17:34:24 -08:00
Ruslan Shestopalyuk cb552f62f2 Create NativePerformance C++ module
Summary:
[Changelog][Internal]

The NativePerformance module functionality corresponds to the [timing extensions of the Performance API standard interface](https://www.w3.org/TR/user-timing/#extensions-performance-interface).

As this is logically separate from `PerformanceObserver` (which may exist without it), it makes sense to have it as a different native module, so there is no coupling between both.

Reviewed By: christophpurrer

Differential Revision: D41690145

fbshipit-source-id: 7443f4c51f54cc2fdddbdb2e89f9a1fa457ab280
2022-12-03 08:32:58 -08:00