Skip to content

perf(utils): speed up and simplify _chunk and _achunk using islice/anext - #3342

Open
vmphase wants to merge 1 commit into
masterfrom
perf/chunk-achunk
Open

perf(utils): speed up and simplify _chunk and _achunk using islice/anext#3342
vmphase wants to merge 1 commit into
masterfrom
perf/chunk-achunk

Conversation

@vmphase

@vmphase vmphase commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

This PR speeds ups and simplifies internal utils._chunk and utils._achunk, which are used by public utils.as_chunks.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • I have read the Contributing Guidelines.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@vmphase
vmphase requested review from a team and Lulalaby August 10, 2026 14:36
@vmphase
vmphase requested a review from NeloBlivion August 10, 2026 14:36
@github-project-automation github-project-automation Bot moved this to Todo in Pycord Aug 10, 2026
@vmphase
vmphase requested a review from a team as a code owner August 10, 2026 14:36
@pycord-app

pycord-app Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3342/head:pr-3342
git checkout pr-3342

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3342/head

@vmphase

vmphase commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

@Lulalaby does this need a changelog? Both are rather internal changes.

@Paillat-dev

Paillat-dev commented Aug 10, 2026

Copy link
Copy Markdown
Member

If the perf gains are noticeable, the changelog could mention that, otherwise no. In any case it should not specify what changed in the internals. Under ## Changed

@Lulalaby

Copy link
Copy Markdown
Member

Nah

@Paillat-dev Paillat-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants