Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2025-01-15] [HOLD for payment 2024-12-25] Benchmark performance bottlenecks when opening chats #50652

Closed
adhorodyski opened this issue Oct 11, 2024 · 69 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@adhorodyski
Copy link
Contributor

adhorodyski commented Oct 11, 2024

Coming from the discussion thread under https://expensify.slack.com/archives/C05LX9D6E07/p1728314452317409

Problem

Lack of solid performance benchmarks across the core app workflows, baselines for proposing performance improvements.

Solution

  • Focus on 1 scenario of opening a chat
  • Benchmark it in detail to get the granular results (also for each phase) so we have solid numbers for whom specifically it's slow and why. There are also analytics we can use for this to have more datapoints.
  • Pinpoint the areas for improvement we see
  • Map how the proposal from initial thread/nitro modules/anything other can fit to improve it

cc @hannojg

Issue OwnerCurrent Issue Owner: @laurenreidexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021873115691475801087
  • Upwork Job ID: 1873115691475801087
  • Last Price Increase: 2024-12-28
@adhorodyski
Copy link
Contributor Author

@mountiny could you please assign this one to me & @hannojg? Thanks!

@hannojg
Copy link
Contributor

hannojg commented Oct 11, 2024

Thanks! 👋

@adhorodyski
Copy link
Contributor Author

adhorodyski commented Oct 16, 2024

Update
Our bottom line is to get super solid on what precisely is slow (have granular measurements) and for whom specifically.

Who
To be able to say how many people something affects (in different percentiles), we need to have something to segment by. We'll extend our performance analytics' metadata (in all envs, including e2e tests) to include the below fields. These will help us group measurements by the types of accounts. (PR: #50881)

  • number of reports ✅
  • number of reportActions 🔄
  • number of personalDetails ✅
  • number of policies 🔄
  • number of transactions 🔄
  • number of transactionViolations 🔄

What
To be able to pinpoint what exactly is slow, we'll implement granular metrics in code, across both App & Onyx. Here's a breakdown of all the phases we decided to focus on.

  • APPLYING_UPDATES (coming over https, until we schedule notifying subscribers)
    • DATABASE_WRITE (actual save operations like multiset and multimerge)
  • NOTIFYING_SUBSCRIBERS (multiple key(s)Changed triggered by scheduleNotifyCollectionSubscribers)
    • DATABASE_READ
    • REACT_PROVIDER - (useOnyx/withOnyx)
  • ONYX_DATA_POSTPROCESSING (from receiving a new update (subscriber got called) until we have the final data)

How
TBC

@adhorodyski
Copy link
Contributor Author

cc @mountiny we'd like to ask you for any feedback about this 1st batch (please invite others!). Is there an area we're missing? I want to make sure we focus on the right parts when profiling this, the exact tools (like e2e suites) will come next once we fully agree on the who&what.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 Weekly KSv2 labels Oct 21, 2024
@melvin-bot melvin-bot bot changed the title Benchmark performance bottlenecks when opening chats [HOLD for payment 2024-10-29] Benchmark performance bottlenecks when opening chats Oct 22, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Oct 22, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.51-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-29. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Oct 22, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@adhorodyski
Copy link
Contributor Author

adhorodyski commented Oct 22, 2024

The extended analytics setup is merged now:

  • to be confirmed it's available in Firebase for newly reported events
  • to be merged into local-based profiling tools (on top of react-native-performance within the Performance module?) so we can use the same parameters in eg. e2e workflows cc @hannojg, I think this is the last thing we have to do when it comes to the 'segmentation' part

@adhorodyski
Copy link
Contributor Author

  • Next part is to implement the granular metrics as listed above

also cc @hannojg, do you think these should also be reported to Firebase OR we just focus on being able to profile this behind some flag?

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 23, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-10-29] Benchmark performance bottlenecks when opening chats [HOLD for payment 2024-10-30] [HOLD for payment 2024-10-29] Benchmark performance bottlenecks when opening chats Oct 23, 2024

This comment was marked as off-topic.

@mountiny mountiny removed the Awaiting Payment Auto-added when associated PR is deployed to production label Oct 24, 2024
@melvin-bot melvin-bot bot added the Weekly KSv2 label Jan 8, 2025
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-12-25] Benchmark performance bottlenecks when opening chats [HOLD for payment 2025-01-15] [HOLD for payment 2024-12-25] Benchmark performance bottlenecks when opening chats Jan 8, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 8, 2025
Copy link

melvin-bot bot commented Jan 8, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jan 8, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.81-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-01-15. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jan 8, 2025

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@rayane-djouah] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@adhorodyski
Copy link
Contributor Author

@muttmuure yeah that was totally I think due to this underlying bug in Hermes. I'll monitor when it's up. @mountiny the latest testflight includes upgrade, correct?

@mountiny
Copy link
Contributor

mountiny commented Jan 9, 2025

Yes

@adhorodyski
Copy link
Contributor Author

Works now

@adhorodyski
Copy link
Contributor Author

Ok so I've found a few bugs on different environments that I can't go over quickly:

  • https://staging.new.expensify.com/ on web allows me to profile, but does not seem to produce the AppInfo file
  • https://new.expensify.com/ on web does not allow me to profile, Use profiling does not toggle on with a console error of [Violation] Document policy violation: js-profiling is not allowed in this document.
  • TestFlight build is similar to the web staging - allows me to profile, but does not produce the AppInfo

cc @hannojg are these known issues, am I missing something? Shouldn't AppInfo actually be produced on all these targets?

@rayane-d
Copy link
Contributor

rayane-d commented Jan 15, 2025

I think no regression test is needed since this is a performance debug tool

My eligibility for NewDot payments began on December 28th. I will request payment via NewDot once the onboarding process is completed.

Copy link

melvin-bot bot commented Jan 15, 2025

Payment Summary

Upwork Job

  • Contributor: @hannojg is from an agency-contributor and not due payment
  • Contributor: @adhorodyski is from an agency-contributor and not due payment
  • ROLE: @rayane-djouah paid $(AMOUNT) via Upwork (LINK)

BugZero Checklist (@laurenreidexpensify)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1873115691475801087/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@melvin-bot melvin-bot bot added the Overdue label Jan 16, 2025
@adhorodyski
Copy link
Contributor Author

I think there are no actions needed in the scope of this task, the feature works as expected though I have some doubts it's equally accessible across all the platforms (it haven't been touched here). Should we follow up on this one as per ^? cc @mountiny

@mountiny
Copy link
Contributor

@adhorodyski if you mean this #50652 (comment) yes lets try to follow up

@laurenreidexpensify
Copy link
Contributor

@rayane-djouah are you onboarded yet for payment?

@melvin-bot melvin-bot bot removed the Overdue label Jan 23, 2025
@rayane-d
Copy link
Contributor

@laurenreidexpensify Not yet. Could you please check the status with the team?

@laurenreidexpensify
Copy link
Contributor

@rayane-djouah have done, am bumping the team to get it resolved today 👍

@rayane-d
Copy link
Contributor

@laurenreidexpensify Resolved! Could you kindly provide a payment summary?

@garrettmknight
Copy link
Contributor

@laurenreidexpensify got the payment request in ND, just need the payment summary when you get a chance. 😄

@laurenreidexpensify
Copy link
Contributor

payment summary

@rayane-d $250 C+ please request in ND

@garrettmknight
Copy link
Contributor

$250 approved for @rayane-d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
Status: Done
Development

No branches or pull requests

7 participants