Skip to content

Bug: using with typescript v5.5 slows down linting by 2.3x #9474

Closed
@walkerdb

Description

@walkerdb

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

Under typescript 5.5 we're seeing typescript-eslint runs take 2.3x longer in our large monorepo than under any previous version of typescript. The slowdown applies to every typescript-eslint build we've tested, including the v8 rc.

We narrowed this down to a specific typescript change by using git bisect in the typescript repo and running our typescript-eslint rules with local typescript builds: microsoft/TypeScript#58045.

All builds prior to that commit run in expected time, all builds after run 2.3x slower. In our case that means 3m45s for ts <=5.4 vs ~8+ min for ts 5.5, with no changes other than the ts version.

I'll also be putting up an issue in the typescript repo since the slowdown seems to be coming on their end, but it seems worth raising here as well.

We can't share the private monorepo but I was able to reproduce a smaller 1.3x slowdown with the same setup in the sentry monorepo, chosen just because it's a large public monorepo that uses typescript-eslint. Our repo uses quite complex types that I'm assuming are somewhat of a pathological case for wherever the slowdown is coming from, which may explain the difference in slowdown size.

Reproduction Repository Link

walkerdb/sentry#1

Repro Steps

  1. after setting up deps, run time yarn lint:js in the ts 5.5 branch, observe the runtime
  2. check out the linked ts 5.4 branch, install deps, and run the same command. It should be noticeably and consistently faster

I've put more detailed repro notes in the linked PR here: walkerdb/sentry#1

Versions

package version
@typescript-eslint/eslint-plugin rc-v8
@typescript-eslint/parser rc-v8
@typescript-eslint/scope-manager rc-v8
@typescript-eslint/typescript-estree rc-v8
@typescript-eslint/type-utils rc-v8
@typescript-eslint/utils rc-v8
TypeScript 5.5.3
ESLint 8.57
node 18.18

the same slowdown applies to typescript-eslint v7 and v6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalThis issue is with another package, not typescript-eslint itselflocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.performanceIssues regarding performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy