optimise sortReportsToDisplayInLHN in SidebarUtils.ts#68291
Conversation
|
cc @OlimpiaZurek 👀 |
|
@JKobrynski I’ve opened a PR with a small refactor of this method, but I think this improvement is a nice enhancement and will deliver even better results. LGTM. |
|
@youssef-lr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@JKobrynski sorry there are conflicts |
…-perf-improvements # Conflicts: # src/libs/SidebarUtils.ts
…-perf-improvements
|
@youssef-lr I just resolved the conflicts in this PR 😄 Can you re-test the changes? Thanks! |
|
looks like reassure is failing, will re-run |
…-perf-improvements # Conflicts: # src/libs/SidebarUtils.ts
|
@youssef-lr problem resolved, can you re-test? Thanks 😄 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.1.99-0 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.1.99-11 🚀
|
Explanation of Change
This issue is a result of the following Slack thread. I originally investigated the problem outlined in the thread, and it turned out there are two outstanding reasons behind it, one of them being
SidebarOrderedReportsContextProvider. @TMisiukiewicz advised to try to optimise the underlying methods, as the provider itself can't be further optimise and we can't get rid of these function calls. This PR aims to introduce some performance improvements tosortReportsToDisplayInLHNfromSidebarUtils.ts, based on the profile trace, this method was quite slow. I can't really benchmark this in the same circumstances as David had, but based on my testing this is an 11% improvement in average execution speed.Fixed Issues
$ N/A
PROPOSAL: N/A
Tests
Offline tests
N/A
QA Steps
Same as Tests section above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop