dchaley / deepcell-imaging

Tools & guidance to scale DeepCell imaging on Google Cloud Batch
8 stars 2 forks source link

Skip regionprops construction #358

Closed dchaley closed 1 month ago

dchaley commented 1 month ago

Previously we were constructing "region properties" objects, even though we were barely using them. This incurred a very large number of albeit very small allocations & function calls but it added up.

This improves performance by:

BEFORE:

Screenshot 2024-10-03 at 1 34 12 PM

AFTER:

Screenshot 2024-10-03 at 1 34 38 PM

just for fill-holes, not the overall which was 113s --> 111s (recall that these profilings are imprecise using cProfile)

BEFORE: (just for fill_holes)

Screenshot 2024-10-03 at 1 35 18 PM

AFTER: (just for fill_holes)

Screenshot 2024-10-03 at 1 36 11 PM

Fixes #357

Paired with @WeihaoGe1009