Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53320
Changelog: [internal]
This improves the defaults the options related to minimum number of iterations and test duration in benchmarks.
If you indicate a minimum duration, we set the minimum number of iterations so the duration is honored. We do the same if what's specified is the number of iterations.
This is useful when you want to make sure all the tests in a benchmark suite use the same number of iterations without having to explicitly set the time to 0 in all of them.
It also changes the default for warmup iterations to be just 1 (that's enough to load all modules and all the code into memory).
Reviewed By: rshest
Differential Revision: D80405287
fbshipit-source-id: 41a61c4d1979db6a25dd30f0c84b5de319416885
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53321
Changelog: [internal]
Just a rename to make it easier to understand.
Reviewed By: rshest
Differential Revision: D80404378
fbshipit-source-id: 3d7e89797be3b92599e07b4b64d2a720756a4f3b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53322
Changelog: [internal]
This changes the types for benchmark functions to improve safety:
1. It makes the return object be an object instead of an interface, to catch when `overriddenDuration` is misspelled.
2. It makes the function always synchronous, as asynchronous tests aren't supported in Fantom (even though they are in `tinybench`).
Reviewed By: rshest
Differential Revision: D80404121
fbshipit-source-id: c0e2fb9f67174432f50e31c399f5b10cfe098ae6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53323
Changelog: [internal]
This just makes it easier to understand when the benchmark itself has started running and how long the benchmark itself took to run.
Reviewed By: rshest
Differential Revision: D80400268
fbshipit-source-id: b447c4c389d563f7b2b1cbe82822d5d3a93272da
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53250
Changelog: [internal]
This updates the types for Fantom benchmarks to support the new `overriddenDuration` option from `tinybench`.
It also exposes a new method in the benchmark namespace to access the same timestamp used in benchmarks.
Reviewed By: rshest
Differential Revision: D80169515
fbshipit-source-id: 59af197eababbf5b8544ee9f1862b206756dc87d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53143
# Changelog:
[Internal] -
This refactors the way Fantom benchmark test results are passed to the top level, making it type safe and more maintainable.
Reviewed By: andrewdacenko
Differential Revision: D79812707
fbshipit-source-id: d8bfef7e1b0c11b277a08f5e4c810f8c1efd7f89
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52925
# Changelog:
[Internal] -
This adds an extra "ranking" report when running Fantom benchmark vs different React Feature flag configurations.
It can be very useful when implementing some particular optimization, to streamline the before/after comparison wit this optimization enabled/disabled.
Reviewed By: andrewdacenko
Differential Revision: D79269601
fbshipit-source-id: f29e761e313d6857e5b3ac65faf2a387a84be9df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52831
# Changelog
[Internal] -
The corresponding `testWithArg` API is similar to the existing `test` one for the Fantom benchmarks, except it would allow to run the same test several times in a parametrized manner, with the set of parameters specified as an array (for now, of numbers).
This allows to easily implement testing patterns such as we have in a View benchmark test, whereas we have a mostly duplicated test body doing a similar thing with 100, 1000, 1500 view component instances etc.
Reviewed By: rubennorte
Differential Revision: D78970312
fbshipit-source-id: 504b7aada648c7213ce698f088ac71d9fde8884b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52828
Changelog: [internal]
Just a small quality of life improvement. It forces the test functions in benchmarks to have the name of the test case if it's an anonymous function, so it shows better in stack traces.
Reviewed By: sammy-SC
Differential Revision: D78924769
fbshipit-source-id: 9b44a49feaae93ccfa90cc726274f0ea013654b1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52759
Changelog: [internal]
This introduces a new environment variable for Fantom to disable benchmarks (`FANTOM_FORCE_TEST_MODE`), without having to run in CI mode.
Reviewed By: rshest
Differential Revision: D78672864
fbshipit-source-id: ef445bd8b36703594658529da2436c75d5b87179
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52106
Changelog: [internal]
This slightly improves the formatting of the output produced by benchmarks, so we can just copy&paste the result to share it as valid Markdown.
Reviewed By: christophpurrer
Differential Revision: D76898244
fbshipit-source-id: dc1040ee3787c7f0dcb747c9fba8eb14086a0087