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.
Calls to
deepcopy
are fairly expensive when working with large number of STACs. Into_dict
methods, a dictionaryd
is instantiated only to havedeepcopy
applied to it for thereturn
value. This seems to be unnecessary.Here's
![image](https://user-images.githubusercontent.com/1977405/110704485-a067f600-81ba-11eb-8407-f0b2134ea5a9.png)
snakeviz
output of somecProfile
timings.Before:
After:
![image](https://user-images.githubusercontent.com/1977405/110704509-a8c03100-81ba-11eb-87eb-b0266823070b.png)
It should be noted that the after includes also the use of
orjson
to optimize ser/de operations. This optimization can be left out ofpystac
because it requires an external dependency and because it can easily be plugged in through aSTAC_IO
subclass