Skip to content

[Performance] Move shouldShowComposeInput out of session state and create ReportFooter #11428

Description

@marcaaron

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?

Chat switch times on Android

What is the impact of this on end-users?

Very slow behavior when switching chats.

List any benchmarks that show the severity of the issue

  1. Build the release version of the app or download from the play store
  2. Switch to any chat
  3. Capture the timing log for the switch (Internal Expensify staff can check this)
command: 'SendPerformanceTiming' name: 'expensify.cash.switch_report.cold' value: '1825' platform: 'android' appversion: '1.2.9-0' authToken: '<REDACTED>' referer: 'ecash' api_setCookie: 'false' email: 'marc@expensify.com' partnerName: 'expensify.com'
command: 'SendPerformanceTiming' name: 'expensify.cash.switch_report.cold' value: '1848' platform: 'android' appversion: '1.2.9-0' authToken: '<REDACTED>' referer: 'ecash' api_setCookie: 'false' email: 'marc@expensify.com' partnerName: 'expensify.com'
command: 'SendPerformanceTiming' name: 'expensify.cash.switch_report.cold' value: '2057' platform: 'android' appversion: '1.2.9-0' authToken: '<REDACTED>' referer: 'ecash' api_setCookie: 'false' email: 'marc@expensify.com' partnerName: 'expensify.com'

Proposed solution (if any)

Move shouldShowComposeInput out of session state and create ReportFooter

  • Each time we navigate to a chat we set the session.shouldShowComposeInput value.
  • This is not great because it will force anything subscribing to session (which is a lot of things) to update when actually only one tiny part of the UI needs to know about this change.

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

It is easier to profile on web than Android but a small improvement on web usually means a big one on Android

Before:

Screen Shot 2022-09-29 at 8 02 01 AM

After

Screen Shot 2022-09-29 at 8 01 07 AM

In this case the improvement is not crazy but seems a bit better:

command: 'SendPerformanceTiming' name: 'expensify.cash.switch_report.cold' value: '1743' platform: 'android' appversion: '1.2.9-0' authToken: '<REDACTED>' referer: 'ecash' api_setCookie: 'false' email: 'marc@expensify.com' partnerName: 'expensify.com'
command: 'SendPerformanceTiming' name: 'expensify.cash.switch_report.cold' value: '1720' platform: 'android' appversion: '1.2.9-0' authToken: '<REDACTED>' referer: 'ecash' api_setCookie: 'false' email: 'marc@expensify.com' partnerName: 'expensify.com'
command: 'SendPerformanceTiming' name: 'expensify.cash.switch_report.cold' value: '1699' platform: 'android' appversion: '1.2.9-0' authToken: '<REDACTED>' referer: 'ecash' api_setCookie: 'false' email: 'marc@expensify.com' partnerName: 'expensify.com'

Platform:

Where is this issue occurring?

  • Android

Version Number: 1.2.9-0

View all open jobs on Upwork

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions