Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {getPreservedNavigatorState} from './createSplitNavigator/usePreserveNavi
// This timing is used to call the preload function after a tab change, when the initial tab screen has already been rendered.
const TIMING_TO_CALL_PRELOAD = 1000;

// Currently the Inbox, Workspaces and Account tabs are preloaded, while Search is not preloaded due to its potential complexity.
const TABS_TO_PRELOAD = [NAVIGATION_TABS.INBOX, NAVIGATION_TABS.WORKSPACES, NAVIGATION_TABS.SETTINGS];
// Currently the Workspaces and Account tabs are preloaded, while Search and Inbox are not preloaded due to their potential complexity.
const TABS_TO_PRELOAD = [NAVIGATION_TABS.WORKSPACES, NAVIGATION_TABS.SETTINGS];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see CPU usage deceases significantly, so 💯 to this change.

But since the most heavy tab is removed from preload tab, I wonder if we really need to preload WORKSPACES and SETTINGS tabs since they're lightweight and most of their data needed for displaying the UI of these two page come from OpenApp.

I tried to remove usePreloadFullScreenNavigators and I don't see different while switching between these tab. Do you have any metric for the usePreloadFullScreenNavigators? And what kind of data did you measured?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hungvu193 while I do not see much difference on Web, I can see preloading of Workspaces and Setting screens bringing good results on mobile - results when navigating from Home to Workspaces on iOS without preloading:

🔴 Duration Diff: 680.679 ms (+332.8%)
🔴 Commit Count Diff: 12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TMisiukiewicz Do you think we still need this preload logic on web at all?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hungvu193 please check this comment. I believe keeping the preloading on web makes sense for both Settings and Workspaces


function preloadWorkspacesTab(navigation: PlatformStackNavigationProp<AuthScreensParamList>) {
const state = getWorkspacesTabStateFromSessionStorage() ?? navigation.getState();
Expand Down
Loading