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:
260k pixel image: 202ms --> 170ms, 32ms 16%
BEFORE:
AFTER:
140M pixel image: 15.6s --> 11.7s, 3.9s or 25%
just for fill-holes, not the overall which was 113s --> 111s (recall that these profilings are imprecise using cProfile)
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:
AFTER:
just for fill-holes, not the overall which was 113s --> 111s (recall that these profilings are imprecise using cProfile)
BEFORE: (just for fill_holes)
AFTER: (just for fill_holes)
Fixes #357
Paired with @WeihaoGe1009