Skip to content

[Metrics] Improve Open Report Performance #77173

Open
53 of 54 issues completed
Open

Description

@rlinoz

Objective

We want to improve the Open Report performance metric.

Target: 1 second

Target cold and warm: 400ms

You can check the current values and monitor progress at:
https://expensify.sentry.io/dashboard/164356/?environment=staging&environment=production&statsPeriod=14d

Issue OwnerCurrent Issue Owner: @TMisiukiewicz

Activity

  1. self-assigned this
    on Dec 9, 2025
  2. LukasMod commented on Dec 10, 2025

    @LukasMod
    Contributor

    Hi, I am Łukasz from Callstack, an expert agency and I can work on this issue.

  3. rlinoz commented on Dec 15, 2025

    @rlinoz
    ContributorAuthor

    @LukasMod picked this up, what are the next steps here?

  4. LukasMod commented on Dec 16, 2025

    @LukasMod
    Contributor

    Sorry for no updates, I was pushing other issue with same priority, moving to this one now

  5. LukasMod commented on Dec 16, 2025

    @LukasMod
    Contributor

    General current metric (14days): 1.41s
    Platform: Chrome web, P90 - 2.54s,
    Latest release: 9.2.78-6 with P90 1.40s

    Releases in sample:
    9.2.78-X (without -0 and -5), 9.2.77-X

    Image

    Based on this sample, the largest impact comes from the following spans (from highest to lowest):

    1. Search
    2. /r/*
    3. MoneyRequestReportPreview
    4. MoneyRequestReportPreviewContent

    I will continue the investigation in this order

  6. LukasMod commented on Dec 17, 2025

    @LukasMod
    Contributor

    I had some time investigate this today, but so far nothing new. I don't think its network related, after few tests with 3G network results look similar (so far testing with wide screen layout).

  7. LukasMod commented on Dec 19, 2025

    @LukasMod
    Contributor

    Big performance impact I noticed is caused by Search rerenders, most likely due to Onyx state updates after fetching openReport data.

    The search screen with the full list of expenses re-renders several times (~6), which can be significant. Especially when the list contains multiple receipt images and many items.

    Example: opening a single report from the expenses list (with CPU throttled to 4×).

    Search (rerenders whole list):
    Image

    Report:
    Image

    A simple test, in which I reduced the number of rendered items to just one, improved navigation time from 4 seconds to 2 seconds. I believe the items in that list should not affect the opened report action at all.

    I will try to find real cause of it and limit this impact.

  8. LukasMod commented on Dec 19, 2025

    @LukasMod
    Contributor

    I managed to get some more data from performance tab, there is a lot of calculations because of these rerenders

    Image

    Almost 1s is took by transaction row updates - 580ms + 350s
    Image
    Image

    I checked and by removing list (and its rerender recalculations) improves time by 33% already. We should figure out how to reduce these rerenders in real scenario.

  9. LukasMod commented on Dec 22, 2025

    @LukasMod
    Contributor

    To remove these rerenders, we would need to address approximately six different areas where they are caused by useOnyx or isFocused changes. I will proceed with this investigation, as there are significant gains to be made from it (~40% if we reduce list rerenders to 0).

    Places causes these rerenders are:

    1. ReportScreen => useEffect (line 670) fetchReport, onyx action
    2. ReportScreen => ReportFooter => ReportActionCompose => AttachmentPickerWithMenuItems => useOnyx read
      const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
    3. ReportScreen => ReportActionsView => ReportActionsList => useOnyx read
      const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
    4. ReportScreen => headerView (MoneyRequestHeader) - don't know specifics yet
    5. Search => SearchList => renderItem => isFocused
    6. Search => SearchList => BaseSearchList => list extraData (isFocused)

    OOO: I will be out of the office from 24.12 to 26.12 due to the Christmas break.

  10. 339 remaining items

  11. rlinoz commented on Oct 16, 2026

    @rlinoz
    ContributorAuthor

    ongoing windows investigation and prs

  12. rlinoz commented on Oct 26, 2026

    @rlinoz
    ContributorAuthor

    Ongoing.

  13. rlinoz commented on Nov 4, 2026

    @rlinoz
    ContributorAuthor

    Ongoing.

  14. self-assigned this
    on Nov 10, 2026
  15. removed their assignment
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions