-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 2024-10-16] [$250] [Performance] Avoid including mapbox in initial web bundle #48202
Comments
Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext. |
@neil-marcellini I know you worked with Mapbox. Do you mind taking over this issue and managing it? There is already a PR for it, I guess we'll want a C+ to review first. |
Huh... This is 4 days overdue. Who can take care of this? |
Waiting for review! |
@sobitneupane would you please review the PR as C+? |
Hi @janicduplessis. Thanks for working on this. I want to make sure this is a problem worth solving, as is our standard practice. Would you please present some benchmarks of the load time for the app with the mapbox bundle included and separate? Or otherwise determine what percentage of the load time comes from Mapbox with a direct measure? Please detail your testing methodology as well. Was a problem and solution presented anywhere in Slack? Would you please write one in the issue description? Once I have that info I'll feel confident about going forward with this or not. |
Job added to Upwork: https://www.upwork.com/jobs/~021832118031291081965 |
Current assignee @sobitneupane is eligible for the External assigner, not assigning anyone new. |
Waiting for @janicduplessis to respond |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@neil-marcellini Here's the network profile for production newdot with network throttling "Fast 4G": ![]() We can see that the loading of JS happens in 2 steps, let's only consider the 2nd step which is when mapbox is loaded. The app loads 3 js bundles in parallel for a total of 6.6mb. From looking at the bundle analyser result we can see that mapbox is included in chunk 62 and weights about 1mb. ![]() I would assume that with limited bandwidth even if the 3 bundles are downloaded in parallel, reducing the size of one will cause the other 2 to download faster. So if we consider those 3 bundles as just one it should be a size reduction of about 15%, which can be about 1s download time reduction. This might not be exactly accurate, but we can measure better on the PR with an adhoc build. There was no official problem / solution presented in Slack, this stem out of the discussion in this thread to improve the website initial loading performance. |
Thanks for writing that out @janicduplessis. I think a 1s/15% time savings on a slow connection is worth it, but just barely. Would you please follow this guide and post your problem solution in #expensify-open-source on Slack? Once we get a good amount of thumbs up we can move forward. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Working on this today |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Posted the proposal on slack. |
Nice, I'm glad to have Rory's support and from others, so let's go ahead with it. 180ms isn't much for the fast 4g but 5s on 3G is big. |
The PR is on staging. I'm assigning a BZ member to handle C+ payment. |
Triggered auto assignment to @slafortune ( |
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.46-5 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-16. 🎊 For reference, here are some details about the assignees on this issue:
|
Payment Summary
BugZero Checklist (@slafortune)
|
@janicduplessis does not require payment (Contractor) |
$250 approved for @sobitneupane |
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?
Reduce the amount of JS needed to load the app by delaying loading of resources that are not needed initially until they are used. One good candidate for this is mapbox, which is only used when creating a distance expense. The map is already not available while offline so this is not a concern.
What is the impact of this on end-users?
This app will load faster initially on web.
List any benchmarks that show the severity of the issue
We can see that mapbox is about 1mb (300kb gzip) of JS by running bundle analyzer (
npm run analyze-packages
). We can also see that this bundle is loaded initially by using chrome devtools network panel.Proposed solution (if any)
Delay loading the map code until the component is rendered by using
React.lazy
. Offline mode is not a concern here since the map doesn't work while offline.List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)
We can see that mapbox is now in its own bundle by running
npm run analyze-packages
. We can also verify that this bundle is not loaded initially and only when rendering a screen that displays the map.Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 9.0.25-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @janicduplessis
Slack conversation:
View all open jobs on Upwork
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Issue Owner
Current Issue Owner: @slafortuneThe text was updated successfully, but these errors were encountered: