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

Create a numpy adaptor for primesieve #11

Open
pstoll opened this issue Nov 13, 2015 · 0 comments
Open

Create a numpy adaptor for primesieve #11

pstoll opened this issue Nov 13, 2015 · 0 comments

Comments

@pstoll
Copy link
Collaborator

pstoll commented Nov 13, 2015

Today primesieve generates a python list of primes. We then take this list and immediately turn it into a numpy array. That is wasteful (generating the the list) and slow. We can do better - create the output numpy array and pass it to the primesieve generate_primes function, so that it writes the primes directly into the output array. This will avoid creating a huge list and copying it later.

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

No branches or pull requests

1 participant