Speed issues during segmentation

Windows version: 10.0.22631 Build 22631
Slicer Version: 4.11.20200930 r29402 / 002be18
Expected behavior: similar slicing speed in case of a geometry and also in case of its inverse
Actual behavior: significant difference in slicing speed

Hello,
we are using Slicer to slice geometries stored in .stl files. The output is stored in black&white .bmp-s.
For each geometry we process two .stl files. If there is volume at a certain coordinate in the first file, there is no volume at the same coordinate in the second file, and vice versa. In other words, the first geometry is the inverse of the second geometry.
Interestingly the processing of the first file is done in a couple of minutes, however, for the second file it can take up to an hour. As I measured the processing time of each phase, it turned out, that the most time consuming step is the
seg.GetSegmentation().CreateRepresentation(‘Binary labelmap’, True) for each slice.
Since we have quite a few .stl-s each day, it would be a huge gain if we could reduce the processing time also for the second, inverse geometry.
What do you think, what could cause the significant time difference in the processing of the two files? Do you have perhaps a recommendation how to accelerate the process?

Such significant speed decrease reminds me of the exponentially increasing processing time as the number of segments increase.

If it is not implemented like that already, make sure you always start with an empty segmentation for each of your STLs.