-
-
Notifications
You must be signed in to change notification settings - Fork 45.7k
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
Performance: 95% faster Project Euler 187 #10580
Closed
ManpreetXSingh
wants to merge
9
commits into
TheAlgorithms:master
from
ManpreetXSingh:reoptimize-euler-187
Closed
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
db7a134
Add numpy calculate_prime_numbers
ManpreetXSingh 11aac84
Rename old solution to for_solution
ManpreetXSingh 8943088
Add numpy solution
ManpreetXSingh d56844a
Update benchmarks
ManpreetXSingh 8b6b3a4
Fix 🐛 in benchmarks in prime_numbers.py
ManpreetXSingh 61219b4
Add prime helper fn in prime_sieve_eratosthenes.py
ManpreetXSingh 938c022
Add benchmark fn in prime_sieve_eratosthenes.py
ManpreetXSingh e6535b1
Sort imports in prime_sieve_eratosthenes.py
ManpreetXSingh 2e28bde
Import prime helper fn
ManpreetXSingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to make this as a helper function in a common module as I see it being used in your other PR as well or maybe add it in
maths/
and re-use it here or (assuming that there's already similar function inmaths/
) re-use an existing implementation?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dhruvmanila,
Please see if I added the helper function correctly.
Also I found out that the benchmark in the file maths/prime_numbers.py was not working as expected, so I fixed it.