Cache requests to /v2/components/<id>#59
Open
nikulin wants to merge 2 commits intosalmiakki:mainfrom
Open
Conversation
5e27b80 to
50a9c4b
Compare
salmiakki
reviewed
Jun 22, 2022
| from prpr.table import DISPLAYED_TAIL_LENGTH, print_issue_table | ||
|
|
||
| COMPONENT_SUFFIXES = "component_suffixes" | ||
| _components_cache = {} |
Owner
There was a problem hiding this comment.
I'd like to avoid global state if possible.
Contributor
Author
There was a problem hiding this comment.
I've pushed new version that used requests-cache. If it's ok, let me know and I'll remove the first commit.
4b0b227 to
0ca7cf7
Compare
This file contains hidden or 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
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.
Decrease script running time by 2 times.
Before changes
ncalls tottime percall cumtime percall filename:lineno(function)
455 0.006 0.000 22.967 0.050 connection.py:91(request)
455 0.003 0.000 22.246 0.049 connection.py:108(_request)
455 0.006 0.000 22.242 0.049 connection.py:132(_try_request)
447 0.008 0.000 21.186 0.047 connection.py:25(method)
After
ncalls tottime percall cumtime percall filename:lineno(function)
12 0.001 0.000 3.735 0.311 connection.py:91(request)
12 0.000 0.000 3.207 0.267 connection.py:108(_request)
12 0.000 0.000 3.207 0.267 connection.py:132(_try_request)
13 0.001 0.000 1.825 0.140 connection.py:307(connect)
4 0.000 0.000 1.383 0.346 connection.py:25(method)