Value types
Regular tuple/record/union are reference-types by default, but it's possible to get them as value-types
Instances stored on the Stack rather than in the Heap
Records, Unions:
[<Struct>]
attributeTuples, Anonymous Records:
struct
keyword
Struct tuples & anonymous records
Struct records & unions
βοΈ Pros/Cons
β Efficient because no garbage collection
β οΈ Passed by value β memory pressure
Recommendations:
Consider structs for small types with high allocation rates
Last updated
Was this helpful?