Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@atapin
Copy link

@atapin atapin commented Jul 4, 2024

Description

Added test coverage for batched_parmap function and improved its readability by simplifying the implementation. Also improved the performance by utilizing list.extend method instead of + concatenation. Extension modifies a list in place, instead of creating a new list by +

Motivation and Context

Currently batched_parmap has unnecessary cyclomatic complexity, because it has to check for trailing chunks of batches in case when size of args is not divisible by batch_size. Even though the check is implemented, this case is not covered by tests.
Also, memory consumption of this function can be reduced by replacing list concatenation with list extension.

Fixes #104

How has this been tested?

I provided a unit test and ran all other tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

atapin added 3 commits July 4, 2024 12:55
…ability by simplifying the implementation. Also improved the performance by utilizing list.extend method instead of `+` concatenation. Extension modifies a list in place, instead of creating a new list by `+`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insufficient test coverage of batched_parmap

1 participant