Registry Mirror
Skip to content

Performance is slow for DSL build with CE #12723

Closed as not planned
Closed as not planned

Description

@albertwoo

I am building a DSL for blazor with CE, but we find that when the code line grows to just 300 the performance is going to be noticable. If we got more logic or more lines it is almost no intellicense because it is too slow.

Repro steps

  1. Create an empty .NET 6 fsharp console project
  2. Add package: dotnet add package Fun.Blazor --version 2.0.0-beta008
  3. Copy below code
open Fun.Blazor

let test =
     div {
        div {
            style'' {
                width 100
                height 100
            }
            "test"
        }
        div {
            style'' {
                width 100
                height 100
            }
            "test"
        }
        // repeat for many times
    }

Expected behavior

Should be fast enough for a single file less than 1000 lines

Actual behavior

Slow start from 300 lines of code in a single file

Known workarounds

No

Related information

  • Windows 11
  • VS 2022 17.1.0 preview 4 (Other IDE like vscode and formal VS still have the issue)

Activity

  1. albertwoo commented on Feb 13, 2022

    @albertwoo
    Author
  2. dsyme commented on Feb 16, 2022

    @dsyme
    Contributor

    TBH this is somewhat expected as things stand - the de-sugaring of CEs can lead to m=plenty of method resolutions and it's not to be taken for granted that it allows very large CE expressions without some penalty in diagnostics and compilation times.

    I'd encourage you to consider this when assessing whether the CE technique is suitable for your DSLs. We can aim to continue to improve compilation times for this, and I'd strongly encourage you to do a profiling run - which would probably quickly determine some low hanging fruit on this path. However there should be no real expectation that using CEs on very large inputs will be free of some downsides - it's in their nature.

  3. albertwoo commented on Feb 17, 2022

    @albertwoo
    Author

    Maybe we should add this to CE docs to let people know its not suitable for large DSL instead of after we spend many times then find out it is not a suitable way. :(

  4. albertwoo commented on Mar 16, 2022

    @albertwoo
    Author

    Compared with 16.11.3 and 17.0.6.
    16.11.3 is faster and more reliable, in 17.0.6, it is very easy to make the VS crash when the code grows.

    The IDE will crash for just 300 lines of CE expression in 17.0.6.

    Can we improve CE performance for codes under 500 lines?

  5. added
    Impact-Medium
    on Mar 28, 2022
  6. added
    Area-Compiler-Checking
    Area-ComputationExpressions
    and removed
    Impact-Medium
    Area-Compiler-Checking
    on Apr 27, 2022
  7. added this to the Backlog milestone on Oct 19, 2022
  8. self-assigned this
    on Apr 13, 2023
  9. removed this from the Backlog milestone on May 4, 2023
  10. vzarytovskii commented on Nov 10, 2023

    @vzarytovskii
    Member

    Let's track this one in #14429, since it has much more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ComputationExpressionsFeature Improvement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions