Introduction
We are currently blind to any regressions that don't directly translate to pixels on the screen. Performance regressions, in particular, isn't always straight forward to measure as different platforms and devices may yield wildly different results depending on how you do the measurements.
The Core of It
A suite of benchmarks and tools should be run on all PRs, and on every commit to master, to catch regressions (or improvements) compared to a baseline.
What we should measure:
- App Size
- Measure the app size and working set of a clean
react-native init app or RNTester.
- Performance Regressions
- React initialization time
- Time to interaction (TTI)
- Native module initialization
- JS parsing
- JS execution
- Number of thread jumps during initialization
- Blocked threads, and how long they were blocked for
- Memory usage
- Memory Leaks
- Static analysis and sanitizers, e.g. run RNTester with MemorySanitizer
- Linters, e.g. Clang-Tidy
- Leverage online code analysis services such as LGTM
- Essentially, look to tools and automation to help us find bugs, memory leaks, and potential security issues.
How do we report this?
- Make comments on PRs (and commits?) commenting on the delta change for all metrics.
- Every night (or every commit on
master) there should be a benchmark run to keep track of performance over time. The report should be publicly available, similar to the Firefox Performance Dashboard.
Suggested Timeline
| Task |
Estimate |
Assignee |
Issue # |
| Implement PR bot for posting comments from CI agents |
1 week |
@tido64 |
1 2 3 |
| Nightly CI builds |
1 week |
@sweggersen |
1 |
| Add reporting for performance regressions compared to master |
1 week |
@tido64 |
1 2 |
| Add reporting for app bundle size |
1 week |
@tido64 |
1 |
| Add app memory usage tests |
1 week |
@tido64 |
1 |
| Add reporting for app memory usage |
1 week |
|
|
| Implement performance markers for React TTI |
2 weeks |
|
|
| Implement performance markers for thread jumps/blocks |
2 weeks |
|
|
| RNTester run with MemorySanitizer |
2 weeks |
@HeyImChris |
|
| RNTester run with UndefinedBehaviorSanitizer |
2 weeks |
@HeyImChris |
|
| Add reporting of static analysis results |
1 week |
|
|
| Implement perf dashboards |
??? |
|
|
| Figure out whether we need a device farm or alternate solutions |
??? |
|
|
Discussion points
- Thoughts?
- Missing metrics?
- Milestones/timeline?
cc @sweggersen, @danrydholm
Introduction
We are currently blind to any regressions that don't directly translate to pixels on the screen. Performance regressions, in particular, isn't always straight forward to measure as different platforms and devices may yield wildly different results depending on how you do the measurements.
The Core of It
A suite of benchmarks and tools should be run on all PRs, and on every commit to
master, to catch regressions (or improvements) compared to a baseline.What we should measure:
react-native initapp or RNTester.How do we report this?
master) there should be a benchmark run to keep track of performance over time. The report should be publicly available, similar to the Firefox Performance Dashboard.Suggested Timeline
Discussion points
cc @sweggersen, @danrydholm