dirac-institute / kbmod

KBMOD (Kernel-Based Moving Object Detection)
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

Speedups and memory savings for ImageCollection and Standardizers #668

Closed DinoBektesevic closed 3 months ago

DinoBektesevic commented 4 months ago

This PR is mostly intended for large ImageCollection optimizations really. The measured performance benefits are substantial in terms of loading times and memory footprint of large image collections:

before 
real    47m44.168s 

after
real    7m42.795s

per-standardizer row we save another 5K of data, or approximately 50% of memory we used to take. I wanted to test the impact on the standardization times, since those must not be significantly impacted, but someone is currently really thrashing the disks so I can't get reliable results. For 3 datasetrefs, should be on the order of a second, I got the following results:

old
Time to standardize A0a collection: 14.083693213993683
Time to standardize A0a collection: 12.05290256603621
Time to standardize A0a collection: 16.573551627923734

new
Time to standardize A0a collection: 16.573551627923734
Time to standardize A0a collection: 4.487202679971233
Time to standardize A0a collection: 13.363859862089157

so I'm going to have to repeat these tests to see what's the damage. I expect a slight increase in time because of the serialization of the WCS takes a bit more steps now, but I don't think it should be that bad.

Speedups include:

Changes to BBox and WCS handling:

Changes to IC:

DinoBektesevic commented 3 months ago

Resolves https://github.com/dirac-institute/kbmod/issues/548 and https://github.com/dirac-institute/kbmod/issues/666