imglib / imglib2-roi

Regions of interest (ROIs) and labelings for ImgLib2
Other
9 stars 8 forks source link

Fix Infinite Loop Empty IterableRegion #32

Closed awalter17 closed 6 years ago

awalter17 commented 6 years ago

The first commit contains the benchmark tests:

Output Before Change:

IterableRandomAccessibleRegionBenchmarkTest.testIteratingNotEmpty: [measured 20 out of 22 rounds, threads: 1 (sequential)]
 round: 0.00 [+- 0.00], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 0, GC.time: 0.00, time.total: 0.06, time.warmup: 0.02, time.bench: 0.04

Output After Change:

IterableRandomAccessibleRegionBenchmarkTest.testIteratingNotEmpty: [measured 20 out of 22 rounds, threads: 1 (sequential)]
 round: 0.00 [+- 0.00], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 0, GC.time: 0.00, time.total: 0.06, time.warmup: 0.02, time.bench: 0.04

IterableRandomAccessibleRegionBenchmarkTest.testIteratingEmpty: [measured 20 out of 22 rounds, threads: 1 (sequential)]
 round: 0.00 [+- 0.00], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 0, GC.time: 0.00, time.total: 0.02, time.warmup: 0.01, time.bench: 0.01

The short version is, there doesn't appear to be any change between the times for non-empty masks.

Additionally, this branch contains unit tests verifying the new behavior. @tpietzsch please let me know if you have any questions or if you'd like any changes.

Closes #31