Repository navigation
[HOLD for payment 2024-06-13] [LOW] [Performance] Add no-spread-in-reduce to avoid recreating array in reduce method #42414
Description
Activity
- addedDailyKSv2KSv2NewFeatureSomething to build that is a new item.Something to build that is a new item.
on May 21, 2024 - addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on May 21, 2024 Triggered auto assignment to @garrettmknight (
NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.Job added to Upwork: https://www.upwork.com/jobs/~011102640f041d624c
- changed the title
[-][LOW] [Performance] Add no-spread-in-reduce to avoid recreating array in reduce method[/-][+][$250] [LOW] [Performance] Add no-spread-in-reduce to avoid recreating array in reduce method[/+]on May 21, 2024 - addedWeeklyKSv2KSv2Help WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributorsand removedDailyKSv2KSv2
on May 21, 2024 Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)14 remaining items
- addedWeeklyKSv2KSv2Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionand removedWeeklyKSv2KSv2
on Jun 6, 2024 - changed the title
[-][LOW] [Performance] Add no-spread-in-reduce to avoid recreating array in reduce method[/-][+][HOLD for payment 2024-06-13] [LOW] [Performance] Add no-spread-in-reduce to avoid recreating array in reduce method[/+]on Jun 6, 2024 Reviewinglabel has been removed, please complete the "BugZero Checklist".The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.79-11 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-06-13. 🎊
For reference, here are some details about the assignees on this issue:
- @kacper-mikolajczak does not require payment (Contractor)
- @DylanDylann requires payment automatic offer (Reviewer)
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:
- [@DylanDylann] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
- [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.
@DylanDylann you've been paid out - no regression test for this one.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Problem
When you use the spread operator in an array reduce, it often leads to a partial object being copied over and over again in a loop.
Especially with large objects, this is very inefficient because ...acc will unnecessarily copy the full object on each iteration, rather than just adding the single key we want to add.
Solution
Prohibit this pattern with a new ESLint rule - no-spread-in-reduce. The above example would result in a lint error, and you might fix it with something more simple and efficient, like this:
@kacper-mikolajczak
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @garrettmknight