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

Speed improvements #16

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kokroo
Copy link

@kokroo kokroo commented Jan 9, 2023

The import code "from termcolor import colored" was present twice per file, across 3 files.

Use != operator instead of "is not" for a string, since it's faster on the CPU and achieves the same result.
Using the += operator to append to a tuple creates a new tuple every time. Instead of that, we can create a list, and then convert the list to a tuple at the end once all the elements have been appended.  This approach is more efficient, computationally.
Use map instead of list comprehension, as it is pure C code and it is way faster.
@kokroo kokroo changed the title Remove duplicate imports Speed improvements Jan 10, 2023
@kokroo
Copy link
Author

kokroo commented Jan 13, 2023

@koul @ajaykrishnan23 @tarunn2799

I request you take a look at this PR, thanks!

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.

1 participant