-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Performance] Simplify isOneOnOneChat Logic and Improve Performance in getParticipantsAccountIDsForDisplay #47336
Comments
Hi, I'm Edu from Callstack and I want to work on this issue |
Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
discussing a bit in slack here |
@Beamanator Since I reviewed this performance issue, am I eligible for a payment? And If yes Looks like production deploy automation failed: This should be on [HOLD for Payment 2024-09-06] according to prod deploy checklist, confirmed in slack |
This issue has not been updated in over 15 days. @Beamanator eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Triggered auto assignment to @OfstadC ( |
@gedu any update on the discussions you linked here? #47300 (comment) @ZhenjaHorbach good call, i do believe you deserve payment! I think we can wait to see if the performance issue caused a regression or not before doing payment 🙏 |
Thanks ! |
@Beamanator Let me know what you need from me here 😃 |
I ping'd @gedu in the PR here, I think it makes sense to pay this out since, as @ZhenjaHorbach mentioned, the PR has been in prod for 2 weeks 🙏 |
The PR is merged and without regressions, should be all good, @Beamanator replied on the PR |
@ZhenjaHorbach Could you please accept the offer here? Then I can issue payment 😃 |
Done ! |
Payment Summary
|
Problem
The current implementation of the
isOneOnOneChat
function uses a complex approach involving mapping and filtering over the participants in the report object. This includes parsing string keys to numbers and filtering out the current user, which can be streamlined for better readability and performance. Additionally, thegetParticipantsAccountIDsForDisplay
function includes extra mapping and string-to-number parsing inside filters, leading to inefficiencies.Solution
Refactor the
isOneOnOneChat
function to a simpler approach that avoids unnecessary mapping and filtering. Instead, directly manipulate the participant count and presence of the current user to determine if the chat is one-on-one. Likewise, improve thegetParticipantsAccountIDsForDisplay
function by moving the string-to-number parsing out of the filter to increase efficiency.The text was updated successfully, but these errors were encountered: