Skip to content

Project Euler: 092 decreased the time #6627

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

Merged
merged 6 commits into from
Oct 30, 2022

Conversation

Saksham1970
Copy link
Contributor

@Saksham1970 Saksham1970 commented Oct 3, 2022

Describe your change:

Contributed to Project Euler problem 092 by:

  • Changing the Dictionary to list to increase speed,
  • Increasing the Digit squared buffer to increase speed for big numbers.

Also added a line in problem 104, which was failing because of Python's new limit. The included line disables the limit and the code works as intended.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@cclauss
Copy link
Member

cclauss commented Oct 3, 2022

Please create https://docs.python.org/3/library/timeit.html benchmarks to prove that the proposed algorithm is as fast or faster than the current implementation.

There are plenty of example benchmarks in this repo https://github.com/TheAlgorithms/Python/search?q=timeit

@cclauss cclauss changed the title Project Eular: 092 decreased the time Project Euler: 092 decreased the time Oct 3, 2022
@Saksham1970
Copy link
Contributor Author

Do I add benchmarking in the same file or a different file, because the benchmarking will affect the time for this file to run in project Euler workflow?

Also, can we not check the time improvement from the said workflow.

@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Oct 5, 2022
@dhruvmanila
Copy link
Member

Do I add benchmarking in the same file or a different file, because the benchmarking will affect the time for this file to run in project Euler workflow?

You just need to provide the time difference, no need to commit the code.

Also, can we not check the time improvement from the said workflow.

If you can, please provide us with the said details.

@Saksham1970
Copy link
Contributor Author

If you can, please provide us with the said details.

Screenshot of Workflow with the commit
image

Screenshot of Older workflow
image

@algorithms-keeper algorithms-keeper bot removed the awaiting reviews This PR is ready to be reviewed label Oct 30, 2022
@cclauss cclauss merged commit 84facb7 into TheAlgorithms:master Oct 30, 2022
@Saksham1970 Saksham1970 deleted the eular-92 branch October 30, 2022 20:17
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.

3 participants