Skip to content

⚡️ Performance: Potential overhead populating implicit globals that don't appear in files #11362

Open
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Suggestion

Coming over from #9575 -> #10561: @dmichon-msft created a very tantalizing proof-of-concept that might help improve linting performance. Copying the description here:

Overview

This PR optimizes populateGlobalsFromLib by deduplicating work to calculate the set of variables available in the configured libs array, and by only injecting implicit variable definitions for variables whose names appear in the file being analyzed.

As a consequence of only injecting implicit variables that are actually used in the file, we can avoid the overhead of lint rules spending time processing irrelevant injected globals, for example in typescript-eslint/no-redeclare and typescript-eslint/naming-convention.

Nobody's had the dedicated time to take that PR to completion. But it'd be really good if we could get it in! That should involve cleaning up the test coverage from the PR, testing it to make sure it's still better for performance, and sending a new PR.

Additional Info

If you send a PR that builds off the code in #10561, please add a co-author attribution to credit the original author.

💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueperformanceIssues regarding performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions