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

speed up getblockcount using numpy #33

Merged
merged 1 commit into from
Jan 1, 2024
Merged

speed up getblockcount using numpy #33

merged 1 commit into from
Jan 1, 2024

Conversation

llGaetanll
Copy link
Contributor

Using numpy's count_nonzero is faster than iterating with python loop!

I've found getblockcount to be quite slow when working with large schematics. Using numpy speeds it up for free.

Using numpy's `count_nonzero` is faster than iterating with python loop!
Copy link
Owner

@SmylerMC SmylerMC left a comment

Choose a reason for hiding this comment

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

That piece of code was a relic from before numpy was used, good catch.

@SmylerMC SmylerMC merged commit 94a1336 into SmylerMC:master Jan 1, 2024
10 checks passed
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.

None yet

2 participants