Skip to content

Conversation

CyrusNajmabadi
Copy link
Member

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 into
tag->event->delay->event->delay->event->delay->event->delay->event->delay->tag

which avoids lots of unnecessary computation.

Drops CPU usage from:

image

to

image

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 31, 2024 19:05
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 31, 2024
Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants