-
Notifications
You must be signed in to change notification settings - Fork 3
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
Optimizations #48
Merged
Merged
Optimizations #48
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And use pathlib to get the suffix. I think this approach is cleaner.
This allows the code after it to be tabbed back, which I prefer. Also I changed comments a little.
I think it's good to have this documented.
This makes it more obvious what it's for.
Adjusted some comments, newlines, formatting. We want to catch it if a queue item is somehow not a correct size tuple, so I'm just doing a generic except instead of excepting Empty. Variables that end in `sig` now end in `_signal`. `_read_thread` no longer takes `thread_index`, as it wasn't using it. Swapped the order of the signal check and try block. Removed manual unregister of timer, as returning None is enough.
There are multiple threads. All the other files follow a plural naming scheme.
bonjorno7
previously approved these changes
May 31, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the state of this branch.
Did make some of my own changes, so you could take a look at those if you want.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR: The PR reduces 1000x calls of
load
in a loop from a total time of 1.7s to 0.01s (within a VMWare VM).Note: The threads and the timer are registered on demand and will be removed automatically when all items have been processed.