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

Remove await from inside of loops #4354

Merged
merged 1 commit into from
Jul 26, 2023
Merged

Remove await from inside of loops #4354

merged 1 commit into from
Jul 26, 2023

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Jul 26, 2023

3/3 main <- #4346 <- #4353 <- this

I turned on eslint's no-await-in-loop and reviewed all instances case-by-case. Of the 30 or so instances of a rule violation, the two in this PR were the ones that stood out.

@mattseddon mattseddon self-assigned this Jul 26, 2023
@mattseddon mattseddon changed the base branch from main to improve-performance July 26, 2023 04:00
@mattseddon mattseddon marked this pull request as ready for review July 26, 2023 04:08
}

const branchLogs = await Promise.all(promises)
const { args, gitLog, rowOrder } = this.collectGitLogAndOrder(branchLogs)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] The order that we collect the information from the promises is important so we need to wait for them all to resolve before we can proceed. This should still give us a performance boost for a large number of branches.

@mattseddon mattseddon force-pushed the remove-loop-await branch 2 times, most recently from 47603e2 to ad5efcf Compare July 26, 2023 07:56
Base automatically changed from improve-performance to main July 26, 2023 20:30
@codeclimate
Copy link

codeclimate bot commented Jul 26, 2023

Code Climate has analyzed commit 11cdce5 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.2%.

View more on Code Climate.

@mattseddon mattseddon merged commit 9b34b38 into main Jul 26, 2023
3 checks passed
@mattseddon mattseddon deleted the remove-loop-await branch July 26, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants