Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49008
Changelog: [internal]
We're modifying some core APIs in the RN render in following diffs, so this adds a simple benchmark as a safety mechanism to verify those don't regress performance significantly.
Reviewed By: yungsters
Differential Revision: D68772175
fbshipit-source-id: 3bc446e68495dc04590b613297baa00589fb5f8d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48882
Changelog: [internal]
The current hint for benchmarks is that the test body contains `unstable_benchmark` calls, but some benchmarks that need to use feature flags define their test bodies in a separate file, so the file containing the call to `unstable_benchmark` isn't the `-itest.js` one.
This adds a new hint to opt into optimized builds that uses the name of the test instead of its contents. If it contains `-benchmark` then we consider it a benchmark and do the opt in.
Reviewed By: andrewdacenko
Differential Revision: D68102300
fbshipit-source-id: 4c0909969f76b8a7d563959cccf686aefaef700d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48570
Changelog: [internal]
We're still iterating on this feature and making sure it reports stable results, so marking it as `unstable` to set expectations.
Reviewed By: andrewdacenko
Differential Revision: D67975844
fbshipit-source-id: 41e93cb9cb0c887a96178e4a4d5078d1899b2478
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48452
Changelog: [internal]
Implements a basic API to run benchmarks with Fantom (using `tinybench` under the hood):
```
import {benchmark} from 'react-native/fantom';
benchmark
.suite('Suite name', {
// options
})
.add(
'Test name',
() => {
// code to benchmark
},
{
beforeAll: () => {},
beforeEach: () => {},
afterEach: () => {},
afterAll: () => {},
},
)
.verify(results => {
// check results and throw an error if the expectations fail
});
```
Features:
* Print benchmark results in the console as a table.
* It opts into optimized builds automatically
* Verifies that optimized build is used (unless manually opting out of the check via `disableOptimizedBuildCheck`).
* Supports verification of results (making expectations and making the test fail if the benchmark doesn't meet some expectations).
Reviewed By: rshest
Differential Revision: D66926183
fbshipit-source-id: 61cfa7689ea7684eb870fbbc815b8d236a1871e6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48178
Changelog: [internal]
Adds a new mode for Fantom to run tests with dev-mode bytecode. Right now the modes were only dev (development with source code) or opt (optimized bytecode).
Reviewed By: rshest
Differential Revision: D66888986
fbshipit-source-id: 34b2566a65d138790e16f8fb5787fd9c2bcde536
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48179
Changelog: [internal]
Migrating this type to an enum, which is safer, because it prevents errors like:
```
// when it's actually 'dev'
if (mode === 'development') {
}
```
Reviewed By: rshest
Differential Revision: D66888985
fbshipit-source-id: 4f3f91fad6ca5256baa2123425b2bad11fe036f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48143
Changelog: [internal]
Just a small cleanup to move `jest/integration/*` to `packages/react-native-fantom`, so everything related to Fantom (config, runner, runtime, etc.) is in the same directory.
Reviewed By: javache
Differential Revision: D66874763
fbshipit-source-id: 8b87d7320c7704f7ce6cd58761508193784f5ce2