Large tables being sorted inside functions doubles the peak memory required, even if the parent caller is replacing the original table with some version of the sorted one. This is because the python garbage collector is not smart enough to know that the higher level reference is going to be replaced and a table sort duplicates the data (the same goes for defragmentation).
The next area to look at here is the test orbit ephemeris generation, as there are lots of id sorting and comparisons done. I think with some smart adjustments we may be able to reduce the peak memory there as well.
Large tables being sorted inside functions doubles the peak memory required, even if the parent caller is replacing the original table with some version of the sorted one. This is because the python garbage collector is not smart enough to know that the higher level reference is going to be replaced and a table sort duplicates the data (the same goes for defragmentation).
The next area to look at here is the test orbit ephemeris generation, as there are lots of id sorting and comparisons done. I think with some smart adjustments we may be able to reduce the peak memory there as well.