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

To optimize and improve the efficiency of the existing clean.py #19

Closed
anupammaurya6767 opened this issue Jun 6, 2023 · 0 comments
Closed

Comments

@anupammaurya6767
Copy link

To make the script more efficient, here are some necessary changes:

  1. Use a set instead of a list to store unique hashes. This will eliminate the need for sorting and dictionary manipulation later.

  2. Instead of repeatedly finding characters in the line, use a single iteration to find the positions of important characters ('&', '=', 'n'). This will improve performance.

  3. Use string methods startswith() and in to check for validity and paste errors. This avoids unnecessary string manipulations.

  4. Instead of appending to the data list multiple times, create a temporary list to store the split lines, and then extend the data list with this temporary list. This reduces the number of list operations.

  5. Replace the loop that removes symbols with a more efficient approach using the translate() method. This avoids iterating over each character individually.

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

No branches or pull requests

1 participant