Skip to content

[Performance] Optimise navigation  #10789

Description

@Szymon20000

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


What performance issue do we need to solve?

Startup time can be improved

What is the impact of this on end-users?

app boot time

List any benchmarks that show the severity of the issue

boot time in debug mode improved by ~400ms after optimising AppNavigator so expect much better results once every navigators/conditionally rendered screens are optimised in a similar way

Proposed solution (if any)

before
Screenshot 2022-09-02 at 13 02 59
after
Screenshot 2022-09-02 at 13 05 02

What it does is basically postponing evolution of the js code until it's actually used.
Of course you need to get rid of corresponding imports from the beginning of the file.

How to do it in navigators?

<Stack.Screen
  name="Profile"
  getComponent={() => require('./ProfileScreen').default}
/>

instead of

<Stack.Screen
  name="Profile"
  component={ProfileScreen}
/>

Such solution should be used for every navigator/screens the app has.

List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)

Note: These should be the same as the benchmarks collected before any changes.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:

View all open jobs on Upwork

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions