Quantcast
Viewing latest article 1
Browse Latest Browse All 38

Comment by Tarmil on Why is it so slow to create records with a field that references a big value in F#?

The thing is, for Set, you need not just equality but comparison. And you can't really do comparison by reference in .NET. So I think you have 2 choices. 1: Add a Guid to BigType, fill it with Guid.NewGuid() when you create a value, and implement a custom comparison on BigType that compares this Guid. The structural comparison on CollectionType will use this custom comparison. 2: switch from Set to Dictionary, which only needs equality and can be referential, but of course works with mutation so it may not be appropriate in your case.

Viewing latest article 1
Browse Latest Browse All 38

Trending Articles