Blank gap between multiple imencode()

Hi guys,

We are accelerating the encoding process with CUDA, and when we obtain the nsight system report, we find that there are multiple gaps between imencode() interface.

In the frontend, we just call the imencode() Python interface many times.
We don’t know if the gap happens before or after imencode(), but the gap length increases with the image size.

So does anyone know what happens in the blank gap, and could we do some optimizations?