Skip to content

perf(lint-framework): remove unconditional lint polling#3678

Open
Elias0419 wants to merge 1 commit into
Automattic:masterfrom
Elias0419:master
Open

perf(lint-framework): remove unconditional lint polling#3678
Elias0419 wants to merge 1 commit into
Automattic:masterfrom
Elias0419:master

Conversation

@Elias0419

Copy link
Copy Markdown

Issues

Fixes #3299

Description

This fixes the high CPU and RAM usage in the Firefox extension. It removes the unconditional polling in LintFramework and replaces it with event-driven linting.

Demo

How Has This Been Tested?

I've been running this patch on my machine for about a week now without issue. There is no more high CPU or RAM usage.
I checked it with pnpm exec biome check --write packages/lint-framework/src/lint/LintFramework.ts

AI Disclosure

  • [ x] I am a human and didn't use any AI.
  • I used LLM features of my editor, but not an agent.
  • I used an AI agent interactively.
  • I am an agent or I got an agent to do the work autonomously.

If Your PR Implements or Enhances a Linter

  • I made up the sentences in the unit tests.
  • The sentences in the unit tests were generated by an AI.
  • I'm using examples from the bug report / feature request.
  • I collected real-world sentences for the unit tests.

Checklist

  • [x ] I have performed a self-review of my own code
  • I have added tests to cover my changes
  • [ x] I have considered splitting this into smaller pull requests.

@elijah-potter

Copy link
Copy Markdown
Collaborator

If I recall, this lint polling was necessary to keep the service worker alive. It might be more prudent to find a way to make these polls less energy intense rather than remove them altogether.

@Elias0419

Copy link
Copy Markdown
Author

If I recall, this lint polling was necessary to keep the service worker alive. It might be more prudent to find a way to make these polls less energy intense rather than remove them altogether.

Hi - thanks for having a look. I think that the keepalive timer you are thinking of is this one:

const keepAliveCallback = () => {

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.

Extension using ~8gb of ram and high CPU

2 participants