Skip to content

[Bug]: ZipFS doesn't implement throwIfNoEntry which is slowing down tsc #4283

@vire

Description

@vire

Self-service

  • I'd be willing to implement a fix

Describe the bug

When running tsc or eslint bins with typescript aware rules, this issue causes typescript program to resolve files for significant amount of time.

I did profile the process and flamegraph boils down to makeError function in pnp.cjs

image

see below on screenshot (the command ran for 25 seconds, but the reporting of non-existing files took most of the time)

image

when I console.log in makeError fn I get

rg ENOTDIR out | wc -l 
   230

and

rg ENOENT out | wc -l 
   59851

can be related to #2120

To reproduce

I could try to recreate a repo to reproduce but it would take some time

Environment

System:
    OS: macOS 12.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 86.58 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.0 - /private/var/folders/gr/8m03w_x95hxct7mpn9_gx8f40000gn/T/xfs-c7a7be7d/node
    Yarn: 3.2.0 - /private/var/folders/gr/8m03w_x95hxct7mpn9_gx8f40000gn/T/xfs-c7a7be7d/yarn
    npm: 8.3.1 - /var/folders/gr/8m03w_x95hxct7mpn9_gx8f40000gn/T/fnm_multishells/47019_1648458043892/bin/npm
  Managers:
    Homebrew: 3.4.3 - /opt/homebrew/bin/brew
    pip3: 22.0.2 - /opt/homebrew/bin/pip3
    RubyGems: 3.0.3.1 - /usr/bin/gem
  Utilities:
    Make: 3.81 - /usr/bin/make
    GCC: 4.2.1 - /usr/bin/gcc
    Git: 2.32.0 - /usr/bin/git
    Clang: 13.0.0 - /usr/bin/clang

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingupholdedReal issues without formal reproduction

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions