dotnet / dotnet/fsharp

Compiler service: parallel parsing.

Open
#14,851 5 comments 0 reactions 0 assignees View on GitHub
Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

**Is your feature request related to a problem? Please describe.**

IDE interactions in F# projects are slow and they make development experience subpar.

**Describe the solution you'd like**

One way to speed them up is to allow all files in a project to be parsed in parallel, when type-checking of multiple files/whole project is about to be performed.

**Describe alternatives you've considered**

Introducing a parsing cache of configurable size, that applies to all endpoints correctly would limit the slowdown caused by slow, sequential parsing. I raised https://github.com/dotnet/fsharp/issues/14848 for that. However:
1. this doesn't apply to first-time parsing after IDE load
2. parsing cache can get full. I do think that a cache large-enough to cover all source files in the solution is likely to have a small-enough memory footprint to be acceptable for most users - so hopefully this isn't very relevant.
3. Every time a project changes, all parsing results get invalidated.

**Additional context**
- Parallel parsing already happens in compilation. Doing the same in the service will be more difficult, as the `IncrementalBuilder` has the idea of sequential type-checking+parsing very much embedded in it (see the `BoundModel` type).
- [A discussion I raised about parallel operations for code analysis](https://github.com/dotnet/fsharp/discussions/14199)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.