Small speedup improvement on the inspection logic in Python #311
+1
−1
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.
In addition to #309 to get through improving the extension performance #307
This PR adds more checks for simple primitive types before doing the "heavy load" for more complex types.
In this situation:
It goes from:
803 ms ± 19.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
for_jupyterlab_variableinspector_dict_list
to
265 ms ± 14 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
Note that this means without #309 and this PR we were adding almost 1 second delay for each cell execution when the variable inspector UI was not open. Even though I'm not testing with so many variables and my arrays aren't too big.
This is a first PR of hopefully more performance improvements