Cancel classification work for the portions of the view outside of hte viewport. #73811
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.
In general, taggers like to compute their work till completion, then delay some cadence, then do the next compute pass after an event comes in (and repeat that continuously). The idea here is that once we've started computing, we might as well finish. That way the work isn't wasted, and so that we have tags that are never too stale.
This is great for what's in view. Ensuring that even if a typer is very fast, everything in view is still catching up to them at a reasonable cadence, without them having to pause.
However, this really isn't necessary for the portions of tagging we do outside of the main viewport. We do this work so that if the goes up/down by a page or so, they don't see snap in of tags (which you can still observe if you go up/down by quite a lot). But the goal is to prevent the snap in. As long as the tags are reasonably accurate (which they generally are) based on the last time we actually tagged then spending the work to recompute those sections continuously is excessive. Note: we still compute them after a few seconds of no activity. But this change us from:
tag->event->delay->tag->event->delay->tag->event->delay->tag->event->delay->tag
intotag->event->delay->event->delay->event->delay->event->delay->event->delay->tag
which avoids lots of unnecessary computation.
Drops CPU usage from:
to