is f# records is the same as .net struct? I saw people talk about f# struct,are they use this term interchangable with F# records? Like in FSharp runs my algorithm slower than P
As Stephen said, it is a reference type. Here is the compiled code(release mode) of type Tup = {x: int; y: int}
:
[Serializable, CompilationMapping(SourceConstructFlags.RecordType)]
public sealed class Tup : IEquatable, IStructuralEquatable, IComparable, IComparable, IStructuralComparable
{
// Fields
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
internal int x@;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
internal int y@;
// Methods
public Tup(int x, int y);
...
// Properties
[CompilationMapping(SourceConstructFlags.Field, 0)]
public int x { get; }
[CompilationMapping(SourceConstructFlags.Field, 1)]
public int y { get; }
}