Repository navigation
boost speed of bucket in the pressence of selection by about 87% - #1304
Merged
OverloadedOrama merged 6 commits intoJul 19, 2025
Merged
Conversation
…mode) by about 87%
Variable-ind
marked this pull request as draft
July 15, 2025 16:01
Variable-ind
marked this pull request as ready for review
July 15, 2025 17:03
OverloadedOrama
approved these changes
Jul 19, 2025
OverloadedOrama
left a comment
Member
There was a problem hiding this comment.
Looks good to me, thank you!
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces two independent optimizations:
1.
lock_selection_rectoptimization:Stores existing selection rect as cache and forces
get_selection_rectinSelectionMapto use cache instead. use this to save time when the rect isn't meant to change between repeated calls (e.g see it's use in Bucket tool_flood_fill). This causes roughly an 87% boost to the area fill algorithm2. area_fill compatible with selection size:
when segments were created in
_compute_segments_for_imageWhen we have selection, this ends up adding segments not necessary for calculation. As an optimization, i change it to
This dramatically decreases the fill time even further.
Benchmark of area_fill on a
30x30selection in a646x646canvasmasterPRRelated optimization that tagged along.
draw_toolanddraw_fill_gapas well (this will be noticeable when drawing a line using Pencil on a 5000x5000 canvas in presence of selection).