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

PrimePY: using array slicing #2

Closed
wants to merge 1 commit into from

Conversation

lekonna
Copy link

@lekonna lekonna commented Mar 25, 2021

Changed to use array slicing and numpy. Increases perf
by 20x

Signed-off-by: Janne Kotka lekonna@gmail.com

Changed to use array slicing and numpy. Increases perf
by 20x

Signed-off-by: Janne Kotka <lekonna@gmail.com>
@lekonna
Copy link
Author

lekonna commented Mar 25, 2021

I have also one without numpy. keep the initialization as in the original and replace the for loop with
this.rawbits[int(factor3/2):this.sieveSize//2:factor] = [False] * len(this.rawbits[int(factor3/2):this.sieveSize//2:factor])

@rhbvkleef
Copy link
Contributor

I think that we can consider slicing faithful, but I am open to discussion.

@oscardssmith
Copy link

IMO, it might be a good idea to have separate python and python_numpy implementations.

marghidanu pushed a commit that referenced this pull request Apr 23, 2021
@marghidanu marghidanu mentioned this pull request May 11, 2021
5 tasks
marghidanu added a commit that referenced this pull request May 25, 2021
@ityonemo ityonemo mentioned this pull request Jun 11, 2021
6 tasks
marghidanu added a commit that referenced this pull request Jun 20, 2021
@rbergen
Copy link
Contributor

rbergen commented Jun 25, 2021

I would agree that slicing is faithful. However, we can't merge this PR until it is opened on the drag-race branch.

This was referenced Jun 25, 2021
@lekonna lekonna changed the base branch from original to drag-race June 28, 2021 05:33
@rbergen
Copy link
Contributor

rbergen commented Jul 21, 2021

Closing due to lack of contributor response. Can be reopened on drag-race branch if desired.

1 similar comment
@rbergen
Copy link
Contributor

rbergen commented Jul 21, 2021

Closing due to lack of contributor response. Can be reopened on drag-race branch if desired.

@rbergen rbergen closed this Jul 21, 2021
@RobCannon RobCannon mentioned this pull request Aug 11, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants