question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compiler service: parallel parsing.

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 7 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
majochacommented, Mar 16, 2023

@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.

0reactions
majochacommented, Mar 14, 2023
  1. looks like one IB is constructed per project, it already gets a complete file list that resides in InitialState (does not change). Parsing happens at the type check phase later.
  2. I think it is safe in the current model where cached ParsedInputs lifetime is connected with IB lifetime. How often are IBs destroyed? That’s a question.
  3. We can’t really cancel a single parsing task at all, from what I understand. I think by the time you unload a project, switch branches etc. there will be no running tasks. What’s to look for is the initial impact, opening first file and waiting for typecheck.
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found