Closed seppeljordan closed 3 years ago
I haven't considered the performance of the script at all, to be honest. In fact, I've added calls to sleep
to make it go slower so as to avoid Youtube from blocking us. Then again, I agree that the implementation has improved :+1:
Thank you for merging this. I noticed the sleep statements.
I guess reducing the runtime cost reduces at least energy consumption.
TL;DR
Provide a new implementation for search_dict that is slightly faster without sacrificing readability (hopefully).
Long-winded explaination
This PR is split into two commits. I tried to explain what I did in the commit messages. I will copy them here for reference:
The aforementioned benchmark can be executed by installing the requirements from
requirements-testing.txt
and executingpytest
.Now with the new implementation
I know that the performance of
search_dict
is not the most important thing, but IMHO being slightly faster makes the program just a little bit better.