We compare 2 cases:
- The first screen contains 20 Timers that are re-rendering each frame.
- The first screen contains 20 Timers that are re-rendering each frame and 20 animations (loop mode).
We test performances on the 2 tabs of first screen and on the second screen for 3 scenarii:
- There is just a stack navigator and a tabview without any optimization.
- We activate react-freeze on react-native-screen with
enableFreeze
. - We activate react-freeze on react-native-screen with
enableFreeze
and we manually freeze the first tab with react-freeze when the user go on the second tab.
We can see in the measures below that performances are the same for all scenarii.
Without freeze | Timer only | Timer + Animation |
---|---|---|
Home | ||
Tab 2 | ||
Screen 2 |
enableFreeze on react-navigation | Timer only | Timer + Animation |
---|---|---|
Home | ||
Tab 2 | ||
Screen 2 |
enableFreeze on react-navigation + react-freeze on Home | Timer only | Timer + Animation |
---|---|---|
Home | ||
Tab 2 | ||
Screen 2 |