Skip to content

Seal FSharpFunc / FSharpTypeFunc implementers to benefit from devirt 🎉 #3020

@NinoFloris

Description

@NinoFloris

As Andy Ayers has started the herculean task https://github.com/dotnet/coreclr/issues/9908 to get to full CLR devirt he has already merged the first pieces.

Specifically interesting is dotnet/coreclr#9230 which is about devirtualizing calls when the runtimetype at the callsite can be determined exactly (newobj) or if the runtimetype is a sealed subtype / the called method is sealed.

The compiler currently outputs FSharpFunc / FSharpTypeFunc (among others) classes without sealing them while I know of no reason it could not seal those.

This would bring F# function invocation performance up quite a notch (as a non virtual call they'll subsequently become inlining targets as well) and has widespread positive performance impact I presume.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions