-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Optimize gc cycles and introduce flag for reduced memory usage #95
Conversation
b144e3a
to
e0e216b
Compare
343125a
to
490faad
Compare
faabfd7
to
b81400a
Compare
let diffLinesStack = Stack.create () in | ||
let countDifference x y = | ||
diffPixelQueue |> Queue.push (x, y); | ||
incr diffCount; | ||
IO1.setImgColor ~x ~y diffPixel diffOutput; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks need to check this again
No description provided.