๐ŸŒ AIๆœ็ดข & ไปฃ็† ไธป้กต
Skip to content

typescript-eslint/performance

typescript-eslint Performance Comparisons

Various performance baselines for typescript-eslint.

๐Ÿ‘ช All Contributors: 2 ๐Ÿค Code of Conduct: Kept ๐Ÿ“ License: MIT ๐Ÿ’ช TypeScript: Strict

Usage

You'll need hyperfine installed locally, such as with brew install hyperfine or winget install hyperfine. See sharkdp/hyperfine#installation.

npm install
npm run generate
npm run measure

You can manually measure individual cases by running hyperfine ../../node_modules/eslint/bin/eslint.js --ignore-failure --warmup 1.

Measured Attributes

The caseEntries values in src/data.ts can be modified to test:

  • files: roughly how many generated files should be linted
  • layout: what rough shape of imports those files exhibit:
    • "even": a single root-level index.ts importing from roughly an even triangle shape of files
    • "references": a single root-level tsconfig.json with project references to a few projects
    • "wide": one root-level index.ts importing from all files in the project
  • singleRun: whether to enable single-run inference as a performance boost
  • types: whether to use parserOptions.project or parserOptions.projectService for typed linting

Results

Right now, parserOptions.project with single-run inference outperforms parserOptions.projectService. This is a performance issue and we are investigating it as a bug.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ files โ”‚ project (even layout) โ”‚ service (even layout) โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 1024  โ”‚ '2.371 s ยฑ  0.029 s'  โ”‚ '2.724 s ยฑ  0.049 s'  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

See typescript-eslint/typescript-eslint#9571 Performance: parserOptions.projectService no longer outperforms parserOptions.project in typescript-eslint.

Result Measurement Notes

  • Example measurements taken on an M1 Max Mac Studio with Node.js 22.12.0
  • These results are similar across TypeScript versions: 5.0.4, 5.4.5, and 5.5.3

Comparisons

The comparisons/ directory contains details on more specific comparisons. See each comparisons/*.md file for details on what's being measured.

Traces

The traces/ directory contains more specific traces for investigations.

โœจ You might consider using 0x for nice flamegraph visuals.

All comparisons were run on a common shape of linting: 1024 files with the "even" (triangle-shaped) imports layout.

Contributors

Jake Bailey
Jake Bailey

๐Ÿค”
Josh Goldberg โœจ
Josh Goldberg โœจ

๐Ÿค” ๐Ÿš‡ ๐Ÿšง ๐Ÿ“† ๐Ÿ”ง

About

Various performance baselines for typescript-eslint.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks