Last 12 weeks · 1614 commits
5 of 6 standards met
For a one-line/no-code update this unlocks a _lot_ of extra speed/parallelism 😄 Example: and now type-check ~35% faster on my machine 🚀 I think this _might_ also positively impact #3993 by reducing syscalls (these are likely not a big contributor though), so would be marginally additive to https://github.com/facebook/pyrefly/pull/3994. Summary Overview Profiling across the corpus showed syscalls eating a surprising amount of CPU. The trait delegates to the crate, which calls on every , even for already-absolute paths. A project absolutizes once per module (plus per glob/config site), so a large one can issue thousands of unnecessary syscalls per run. This is especially damaging under parallelism: is a process-global syscall that contends across threads, so the cost/impact grows with thread count. Solution Enabling 's "once_cell_cache" feature resolves the just once, via a thread-safe cell, and reuses it. _This completely eliminates the parallel contention without touching any code_. Test Plan No type-checking logic (or actual code!) was changed. All test results are identical before/after. Benchmarks[^1] Timed single-threaded and multithreaded . Tested across ~60 of the projects. = how many modules are in the project. = pyrefly on main branch. = main + this PR. Results below omit trivially-sized or very fast running-projects. Time in seconds, min of 4 runs after warmup. [^1]: Test machine: Apple Silicon M3 Max.
Describe the Bug Sandbox Link https://pyrefly.org/sandbox/?code=CYUwZgBAjgriDOAXAlgewHYAoCUEC0AfBAEaqoA2AXAFAR0QBOIiMD6EAKg3NbwMbkAhvHgQAgjXoRBDAOaUIydIggAfCADkMICLyVIIAXnE5qAYmnFRyUeVSDgJEDKWzq%2BxADoZso5fiYSoiYAAzY2HqQsAgoGDiS9BbwIDrEAJ6IIHyooBDwyABeOtkAtiUgyorsiAAWOoJWFDCZEABWMCUADhB8wvWkAG4gtPQe3nIQANTGAExAA&version=3.12 (Only applicable for extension issues) IDE Information _No response_
Repository: facebook/pyrefly. Description: A fast type checker and language server for Python Stars: 6731, Forks: 426. Primary language: Rust. Languages: Rust (80.3%), Python (15%), MDX (2.3%), TypeScript (2%), Shell (0.2%). License: MIT. Homepage: http://pyrefly.org/ Topics: code-quality, ide, language-server, language-server-protocol, lsp, python, rust, type-annotations, type-check, type-checker, type-hints, typecheck, typechecker, typechecking, types, typing, vscode-extension. Latest release: 1.1.1 (1w ago). Open PRs: 100, open issues: 618. Last activity: 3h ago. Community health: 87%. Top contributors: stroxler, ndmitchell, rchen152, yangdanny97, kinto0, migeed-z, grievejia, connernilsen, samwgoldman, dluo and others.