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

Use array slicing to provide ~30-35x improvement with pure python #929

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

koog1000
Copy link
Contributor

Description

Use python array slicing to improve performance. No additional libraries, follows same structure as solution 1. Syntactically it is more difficult to read, but functionally does exactly the same thing.

  • I read the contribution guidelines in CONTRIBUTING.md.
  • I placed my solution in the correct solution folder.
  • [ ] I added a README.md with the right badge(s). Not applicable
  • [ ] I added a Dockerfile that builds and runs my solution. Not applicable
  • I selected drag-race as the target branch.
  • All code herein is licensed compatible with BSD-3.

@rbergen
Copy link
Contributor

rbergen commented Jun 22, 2023

@davepl I can confirm an increase from 22 iterations per 5 seconds to 483 iterations per 5 seconds on my machine, so approximately 22-fold. Do you have any objections to merging this change to your Python solution?

@davepl
Copy link
Contributor

davepl commented Jun 22, 2023 via email

@rbergen
Copy link
Contributor

rbergen commented Jun 22, 2023

I'll take that as a "no objections" 😄

Copy link
Contributor

@rbergen rbergen left a comment

Choose a reason for hiding this comment

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

LGTM!

@rbergen rbergen merged commit f1bb725 into PlummersSoftwareLLC:drag-race Jun 22, 2023
159 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.

3 participants