web-infra-dev / rsdoctor

A one-stop build analyzer for Rspack and Webpack.
https://rsdoctor.dev/
MIT License
357 stars 21 forks source link

[Perf]: need optimize the createPackageGraph algorithm. #414

Closed easy1090 closed 2 weeks ago

easy1090 commented 2 weeks ago

Version

System:
    OS: macOS 13.2.1
    CPU: (12) x64 Apple M2 Max
    Memory: 2.09 GB / 64.00 GB
    Shell: 5.8 - /usr/local/bin/zsh
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 16.3
  npmPackages:
    @rsdoctor/core: 0.3.6

Details

In some repositories, a large amount of time is spent on the createPackageGraph function. It is because the path.relative api. So optimize the algorithm of contain function. image