Skip to content

[Optimization] Infer or respect IsReadOnly on all structs to remove unnecessary copies #8970

@NinoFloris

Description

@NinoFloris

C# has the possibility to mark types and members as readonly on structs to signal to roslyn no defensive copies have to be performed. F# with its immutable by default semantics should take advantage of this to gain end users some automatic perf improvements.

Relevant language feature docs:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct#readonly-struct

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions