Skip to content

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