HASTE-project / microscope-simulator

Simulate a high-content imaging experiment
0 stars 0 forks source link

'Period' should account for time loading and sending image #3

Open benblamey opened 6 years ago

benblamey commented 6 years ago

The code should:

  1. Figure out the timestamp when we need to send the next image next =(now + period)
  2. Load, process, send the current one.
  3. Sleep for (next - now)

This may help with issue when throughput is off for high frequencies

Update: doing this will not be enough to achieve theoretical max speed streaming - as a period of 0 results in 10 images per second. We need to read all the test images into memory, convert them appropriately, then send them. Theoretical maximum would be 50 images per second (for each thread), 3 threads needed to reach 150/second

benblamey commented 6 years ago

Under benchmarking, merely preparing the image for sending can take ~0.08secs, sending it takes ~0.02 seconds = total 0.1seconds per file. "Full speed" streaming will not exceed 10images/second

benblamey commented 6 years ago

38 frames / second x 4 color channels = 152/sec is theoretical maximum of the Yokogawa microscope

benblamey commented 6 years ago

With one processing container, processing is slower, so this issue does won't affect the overall throughput of the system.

benblamey commented 6 years ago

% See: benchmarking-simulator,2018-01-29-b Running the simulator... total time: 45.38119649887085secs durations as % of total streaming time: image_binning 0.0013759404926278853% image_to_bytes 64.32788427624905% prepare_image_bytes_method 68.11610430698585% read_image_from_disk 3.6551057999469525% stream_all_images 100.0% stream_file 20.374065210248805%