feat: Optimize gc cycles and introduce flag for reduced memory usage#95
feat: Optimize gc cycles and introduce flag for reduced memory usage#95dmtrKovalenko merged 4 commits intomainfrom
Conversation
b144e3a to
e0e216b
Compare
343125a to
490faad
Compare
faabfd7 to
b81400a
Compare
| let countDifference x y = | ||
| diffPixelQueue |> Queue.push (x, y); | ||
| incr diffCount; | ||
| IO1.setImgColor ~x ~y diffPixel diffOutput; |
There was a problem hiding this comment.
@dmtrKovalenko
Setting the diff color directly can break the antialiasing detection in some cases.
When diffMask is off, we are changing the pixel color on the base image directly, which we might use later to determine antialiased pixels.
(Remember, that we look at the surrounding 8 pixels to detect antialiasing). So we do look at "past" pixels, which with this change might not be the original color anymore.
There was a problem hiding this comment.
But the output image is a totally new buffer copied from the original image and not the same source.
This queue is having a lot of memory overhead for every run
There was a problem hiding this comment.
I think on line 30 its the same buffer we use for comparison. We only create a new buffer, when "outputDiffMask" is true.
I might be wrong though. Its been a long time since i looked at this code 😄
There was a problem hiding this comment.
Thanks need to check this again
No description provided.