Skip to content

Compilation time degrades x3 to x4 times when consuming project targets net7.0 or net8.0 (rather than net6.0) #146

Closed
@DunetsNM

Description

@DunetsNM

I have a project with a lot of complex Fleece codecs.

Codecs have never been too fast to compile (due to heavy usage of SRTP) but after I tried to upgrade <TargetFramework> value from net6.0 to net7.0 or net8.0 it got worse.

  • The project used to take 35 to 45 seconds to compile, with net7.0 it deteriorated to circa 2:30, similar number for net8.0

  • It doesn't look like it's related to some specific codecs, just sheer amount of them. The more I delete/comment out the faster compilation becomes (dropping to just 15 seconds when all codecs are removed - same number for any target, net6/net7/net8 i.e. slowness is 100% codec-related).

  • There were many changed parts between net6 and net7/net8 versions of my projects (e.g. different versions of FSharp.Core and FSharpPlus, newer SDK) but apparently the single cause of compile time degradation is the TargetFramework value: if I change it back to net6.0 while keeping all other changes, compilation time improves / goes back to normal.

  • I tried to fork Fleece, added net7.0 and net8.0 targets to it and consumed from my project. It did not help.

The main suspect is SRTP and inlining which is heavily used in codecs. Did something change in newer F# versions that made it so much slower to compile on average?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions