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

Possible speed-ups for get_grouped_by_powers #16424

Open
nstarman opened this issue May 9, 2024 · 0 comments
Open

Possible speed-ups for get_grouped_by_powers #16424

nstarman opened this issue May 9, 2024 · 0 comments
Labels
Effort-low good first issue Issues that are well-suited for new contributors Package-novice Performance units

Comments

@nstarman
Copy link
Member

nstarman commented May 9, 2024

This function uses .append. It looks like with a simple helper function (defined externally to this function) we could use a list comprehension instead. I wonder if that would be faster — append versus function call overhead.

Originally posted by @nstarman in #16392 (comment)

itertools has a recipe for this type of dual-list creation loop. Doing two loops at the C-level might be faster than 1 loop with constant appending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort-low good first issue Issues that are well-suited for new contributors Package-novice Performance units
Projects
None yet
Development

No branches or pull requests

2 participants