This was noticed in #6047 but not addressed in #6048
Although the range type overrides GetHashCode to call the hash function on two int64s, which specializes to that numeric type as you'd expect, the actual call chain ends up boxing the range type because it calls GenericHashIntrinsic:
https://github.com/Microsoft/visualfsharp/blob/44c7e10ca432d8f245a6d8f8e0ec19ca8c72edaf/src/fsharp/FSharp.Core/prim-types.fs#L1795
Ranges are hashed all of the time in normal IDE usage, including in various routines that will call hash directly or through the use of a distinct or groupBy function.
The net result was a few hundred MB in allocations over ~90 seconds of normal IDE usage.
This was noticed in #6047 but not addressed in #6048
Although the
rangetype overridesGetHashCodeto call thehashfunction on twoint64s, which specializes to that numeric type as you'd expect, the actual call chain ends up boxing therangetype because it callsGenericHashIntrinsic:https://github.com/Microsoft/visualfsharp/blob/44c7e10ca432d8f245a6d8f8e0ec19ca8c72edaf/src/fsharp/FSharp.Core/prim-types.fs#L1795
Ranges are hashed all of the time in normal IDE usage, including in various routines that will call
hashdirectly or through the use of adistinctorgroupByfunction.The net result was a few hundred MB in allocations over ~90 seconds of normal IDE usage.