Skip to content
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

AutoMapping: Removed the "touched layers" optimization #4168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bjorn
Copy link
Member

@bjorn bjorn commented Feb 3, 2025

The "AutoMap While Drawing" had an optimization where it skipped entire rule maps when none of their input layers had been "touched". This was based on the assumption that its rules would not need to be re-evaluated anyway.

Unfortunately, we can't make this assumption in general. The effect of certain rules might be relevant even if none of their input or output layers have been touched.

The "AutoMap While Drawing" had an optimization where it skipped entire
rule maps when none of their input layers had been "touched". This was
based on the assumption that its rules would not need to be re-evaluated
anyway.

Unfortunately, we can't make this assumption in general. The effect of
certain rules might be relevant even if none of their input or output
layers have been touched.
@eishiya
Copy link
Contributor

eishiya commented Feb 3, 2025

Had a go with this using my enormous set of Automapping rules. None of the rules were affected negatively by the optimization. Removing the optimization has made Automap While Drawing even with a 1x1 brush noticeably more sluggish. It's still acceptable, but less pleasant than before, when it was practically instant.

I wonder if perhaps the optimization could be brought back, but with a rule map property like "NeverSkip" (previously discussed in #3313) that'll force that rule map to be used even if its layers weren't touched, so that those rules that are impacted negatively by the optimisation have some recourse.

@bjorn
Copy link
Member Author

bjorn commented Feb 4, 2025

I wonder if perhaps the optimization could be brought back, but with a rule map property like "NeverSkip" (previously discussed in #3313) that'll force that rule map to be used even if its layers weren't touched

With this generic name I'm a bit worried it might be understood as a way to make an exception for file name filters. Although, such an exception isn't needed at that level because it can be made by temporarily resetting the filter. In the end I guess that's a documentation issue (and another reason to enable tooltips on custom properties).

@eishiya
Copy link
Contributor

eishiya commented Feb 4, 2025

It could be named something else, especially since Automapping properties are automatically suggested and don't need to be typed and can thus be fairly descriptive, the only drawback to long names is that they're only helpful for English-speakers. Tooltips would be good even for basic names in combination with translations.

"NeverSkip" being generic is a potential problem in case other, orthogonal optimisations are added in the future. Might even be cool to have a "SkipOptimizations" property that's a bunch of flags for different skippable optimizations.
Perhaps if we have a boolean property "SkipOptimizations" (or "IgnoreOptimizations") for now, it could be converted to flags later if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants