-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Domain: PerformanceReports of unusually slow behaviorReports of unusually slow behavior
Description
Running tsc on this .ts file results in a number of unnecessary file system accesses
import * as fs from "node:fs";
fs.chmod; // Prevent it from being unusedOn my box, it searches
/home/amcasey/repos/perf_utils/node_modules/node:fs
/home/amcasey/repos/perf_utils/node_modules/node:fs.ts
/home/amcasey/repos/perf_utils/node_modules/node:fs.tsx
/home/amcasey/repos/perf_utils/node_modules/node:fs.d.ts
/home/amcasey/repos/perf_utils/node_modules/@types/node:fs
/home/amcasey/repos/perf_utils/node_modules/@types/node:fs.d.ts
/home/amcasey/repos/perf_utils/node_modules/node:fs.js
/home/amcasey/repos/perf_utils/node_modules/node:fs.jsx
Since file system access has been a performance bottleneck in the past, it would be nice to avoid these checks.
(Caveat: Linux actually allows colons in file names, so this would technically change the resolution behavior. I can't tell whether it's by-design or not that it might find node:fs.ts on disk.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Domain: PerformanceReports of unusually slow behaviorReports of unusually slow behavior