Compiler service: parallel parsing.
See original GitHub issueIs 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:
- this doesn’t apply to first-time parsing after IDE load
- 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.
- 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 theBoundModel
type). - A discussion I raised about parallel operations for code analysis
Issue Analytics
- State:
- Created 7 months ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Parallel parsing made practical
The property of local parsability allows to parse inputs through inspecting only a bounded-length string around the current token.
Read more >Concurrent parsing algorithms
Are there existing parser algorithms (similar to LALR, SLR and LL) that can parse a single input, not just multiple inputs, in parallel?...
Read more >Parallel LL parsing | SpringerLink
A deterministic parallel LL parsing algorithm is presented. The algorithm is based on a transformation from a parsing problem to parallel ...
Read more >What are the pros and cons of a compiler with a single- ...
To clarify: what I mean by "single pass" is not to smash the usual passes (parsing, type-checking, optimization, and code gen) together into...
Read more >Parallel Lexing, Parsing and Semantic Analysis on the GPU
In this thesis, we describe the design and implementation of the front end of a compiler of which all major stages can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@safesparrow I have something that works already and shows some modest gains in benchmarks. It feels OK in the IDE, although I yet have to install it and use for a while.