Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53711
Changelog: [internal]
This removes some fields that contain the same time as `endTime`, which is confusing when documenting them.
Reviewed By: christophpurrer
Differential Revision: D82112473
fbshipit-source-id: 461e2b4b495ae641dcb3233874360a4f7b90dabf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53547
Changelog: [internal]
This creates a new feature flag to enable the modern Web performance APIs in RN by default. It's disabled by default so it shouldn't have any effect at the moment.
Reviewed By: rshest
Differential Revision: D80811430
fbshipit-source-id: 47d5fd12ac8809aa3c5ad37cdd31c0d9e3ed5912
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51019
Follows D72228547 and D73770609.
This diff internalises (moves files from fbsource+GitHub to fbsource only) a number of RNTester examples which referenced `'react-native/src/private/'` subpaths.
In future, new components/APIs should be exported from index as `unstable_`, or added to `RNTesterListFbInternal` if they are exported from `src/fb_internal/`.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D73777092
fbshipit-source-id: d9fb0833c56f2ae580b6db62ddbbbeae774a0004
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48940
The PerformanceObserver (marks and measures) example clears it's output each time a new PerformanceObserver event fires, which makes it not particularly useful.
This change makes it so the output is only updated if a non-empty list of performance events is observed.
## Changelog
[Internal]
Reviewed By: rubennorte
Differential Revision: D68634361
fbshipit-source-id: 71b97e1c66aabd090cae63d55c8fa0a425d0c2f4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46898
Replaces *many* `Text` component usages with `RNTesterText`: a thin wrapper around `Text` that applies color based on the color scheme chosen by the user. It makes text legible for dark mode across 41 different example files. This changes intentionally do not touch a few larger component sites that expand beyond RNTester, like `Animated` and `NewAppScreen`
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D64053464
fbshipit-source-id: 9516fef2afe1b364eb38e85e3a2dbb5c434e44db
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46759
Changelog: [internal]
This improves the example in RNTester for `performance.mark` and `performance.measure` by only listing the marks/measures explicitly emitted from the example. This removes noise if other parts of the app are logging marks/measures as well.
Reviewed By: rshest
Differential Revision: D63695731
fbshipit-source-id: f65cf59363da0e6c9e0b3ffadf05abd2eb5a214c
Summary:
Changelog: [internal]
(this functionality hasn't been enabled in OSS yet, so no changelog necessary).
Fix https://github.com/facebook/react-native/issues/45122.
performance.mark is currently O(1) but performance.clearMark is O(n) (being n the number of entries in the buffer), which makes this operation very slow.
### Changes overview
- Created new `PerformanceEntryBuffer` abstraction with the following subtypes, that differ on how entries are stored:
- `PerformanceEntryCircularBuffer` - stores them in a ring buffer that was already implemented, removed key lookup cache (`BoundedConsumableBuffer`)
- `PerformanceEntryKeyedBuffer` - stores them in a `unordered_map`, allowing for faster retrieval by type
- `PerformanceEntryLinearBuffer` - a simple infinite buffer based on `std::vector`, currently used in a `PerformanceObserver`
- Created `PerformanceObserver` abstraction on native side.
- Created `PerformanceObserverRegistry` that collects active observers and forwards entries to observers that should retrieve them
- Moved some method implementations to `.cpp` files to reduce potential compilation time slowdown. As the `PerformanceEntryReporter` can be included from anywhere in the code, it will be beneficial to make header files as light as possible.
- Add comments to methods that note which standard is the method from/for.
- Added some `[[nodiscard]]` attributes
- Since the logic of routing entries to observers is moved to native side, JS side of the code got much simplified
- If ever needed, `PerformanceObserver` can be created from native-side
Standards covered:
- https://www.w3.org/TR/performance-timeline
- https://www.w3.org/TR/event-timing/
- https://w3c.github.io/timing-entrytypes-registry
- https://w3c.github.io/user-timing/
Pull Request resolved: https://github.com/facebook/react-native/pull/45206
Test Plan:
I've tested this e2e on IGVR and in the RNTester playground for the performance APIs. Everything works as expected.
There are also new unit tests for this.
C++ test results: https://www.internalfb.com/intern/testinfra/testconsole/testrun/8725724513169247/
Reviewed By: rshest
Differential Revision: D63101520
Pulled By: rubennorte
fbshipit-source-id: 5970b5c14692ff33ffda44a9f09067f6a758bdbe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45473
This is a basic implementation of the Long Tasks API (https://w3c.github.io/longtasks/).
It detects and reports long tasks when using the Event Loop (in the modern RuntimeScheduler) when a new feature flag for this purpose is enabled.
This doesn't include attribution information at the moment.
Changelog: [internal]
Reviewed By: sammy-SC
Differential Revision: D55491870
fbshipit-source-id: e1ccad9cc6a35073b31230a8cf3a4660ab9a043d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43848
Changelog: [internal]
This makes it easier to see the behavior of the new Event Timing API in RN.
Reviewed By: sammy-SC
Differential Revision: D55646393
fbshipit-source-id: 441fed789a980211783f04095303a139e7b08483
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43706
Changelog: [internal]
Just a small improvement of the UI for the Performance API examples in RNTester.
Reviewed By: christophpurrer
Differential Revision: D55489933
fbshipit-source-id: a1fe4f4962227941827f02cf18a0d4685e18f006
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43704
Changelog: [internal]
Adding examples of the rest of APIs in `Performance`/`PerformanceObserver` starting with marks and measures.
Reviewed By: rshest
Differential Revision: D55477746
fbshipit-source-id: 965796b6a97dc527192093e3c93af837a4d5b714
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42769
Changelog: [internal]
These APIs are not currently enabled in OSS, so moving the modules should be safe and not considered a breaking change.
Reviewed By: NickGerleman
Differential Revision: D53267565
fbshipit-source-id: edd3daa7c5043e44e5fd4b1af074093ed3ef4152
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42762
This renames `performance.reactNativeStartupTiming` as `performance.rnStartupTiming` to align with the recommended vendor prefix for React Native.
This API is still private, so it's safe to rename.
Changelog: [internal]
Reviewed By: javache
Differential Revision: D53264515
fbshipit-source-id: 6e7a222901071594cac0ca8a0ac78e56e60ab132
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38323
This change makes the returned values from `performance.reactNativeStartupTiming` to accept null or undefined. This is done as some platforms may not have certain startup timing information, and as a default value, it's discussed that null/undefined is better than zero.
- Use `unorderedMap` instead of custom timing object for the C++ native module return value
- Use `std::nan` as initialized value for unset doubles
- Update examples to reflect the latest changes
Changelog:
[General][Internal] - Make the return values for `reactNativeStartupTiming` possible to be null or undefined
Reviewed By: mdvacca
Differential Revision: D43885535
fbshipit-source-id: f35292f2e9cdf98750d0d80b9e3bcdcddc560fb7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38858
Pull Request resolved: https://github.com/facebook/react-native/pull/38328
This diff adds the two extra markers `initializeRuntimeStart` and `initializeRuntimeEnd` to the startup performance API. The runtime start time matches the existing android marker `GET_REACT_INSTANCE_MANAGER_START`, which is the first marker we have on the RN android app.
Changelog:
[Android][Added] - Add `performance.reactNativeStartupTiming.initializeRuntimeStart` and `performance.reactNativeStartupTiming.initializeRuntimeEnd` API
Reviewed By: rshest
Differential Revision: D47941110
fbshipit-source-id: d7e65f822f1c60a46dccacc8fd5bba84174f9f31
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38328
This diff adds the two extra markers `initializeRuntimeStart` and `initializeRuntimeEnd` to the startup performance API. The runtime start time matches the existing android marker `GET_REACT_INSTANCE_MANAGER_START`, which is the first marker we have on the RN android app.
Changelog:
[Android][Added] - Add `performance.reactNativeStartupTiming.initializeRuntimeStart` and` `performance.reactNativeStartupTiming.initializeRuntimeEnd` API
Reviewed By: mdvacca
Differential Revision: D43863974
fbshipit-source-id: 277d35e14dbb5e3def8d440b717b3cf0215b4f47
Summary:
Right now RNTestePage either adds a large spacer to the end of content, unless `noSpacer` is added. But with `noSpacer`, scrolling content may not be reachable because we are putting padding on the wrong container.
This fixes that and removes a few cases where we had multi hundred px empty space in favor of uniformly taking up the parent, and a 10px padding. This also moves the constant margin at the top of RNTesterBlock to the container, so that in the E2E container we can save the 30px.
Changelog:
[Internal]
Reviewed By: javache
Differential Revision: D44197303
fbshipit-source-id: 8dc67f3588bc28316e2fee8d25a0bc59995f1728
Summary:
Recent integration from Windows brought in PerformanceApiExample that uses relative pathing to access react-native library. This causes us to have to override the file since our file structure is different. https://github.com/microsoft/react-native-windows/issues/11373
This PR changes the example to use module pathing instead.
## Changelog
[GENERAL] [CHANGED] - Change PerformanceApiExample to use ModulePathing
Pull Request resolved: https://github.com/facebook/react-native/pull/36478
Test Plan: Tested and passed Windows tests
Reviewed By: rshest
Differential Revision: D44089501
Pulled By: javache
fbshipit-source-id: 99993a4f81556b4fef7c5d15af26b20df960ebf9
Summary:
This diff refactors performance memory API and the RN Tester example.
- The returned value from C++ is number, so no need to cast
- Reuse `MemoryInfo` in RNTester example
Changelog:
[General][Internal] - Code refactor for performance memory API implementation
Reviewed By: rubennorte
Differential Revision: D43523878
fbshipit-source-id: 37d1f6a829a8eac45f7e3791ad36be0c199c6041
Summary:
This diff adds the `performance.reactNativeStartupTiming` API to the performance global object for RN. This property does not exist in web, and we are free to make up our own list of properties in the startup metrics to track RN app startup process. In our case, we have the following six properties to begin with (we may extend and add more to this list in the future):
```
- `(start|end)Time`: The time ‘zero’ for the startup timing and the end of app startup. RN has no knowledge of app start time, which will be provided by the platform. The `endTime` will be the time when the first JS bundle finishes executing (Note that RN supports multiple JS bundles, which can be loaded async)
- `executeJavaScriptBundleEntryPoint(Start|End)`: The time for RN to execute the JS entry point (and finish all sync job)
```
Changelog:
[General][Added] - Add new JS performance API to support getting RN app startup timings
Reviewed By: rshest
Differential Revision: D43326564
fbshipit-source-id: 7b4c7cae70ff64ba1714a1630cd5e183df6c06b0
Summary:
Add performance API example to RN tester, start with the `performance.memory` API.
- Update `RNTesterList` file for both android and ios
Changelog:
[General][Internal] - Add `performance.memory` API example to RNTester
Reviewed By: rshest
Differential Revision: D43326565
fbshipit-source-id: adeb18ce9f1f90d9e9ecf66b533307028bc02df8