Piling on here - My impression of your snippet here is that GroupBy() and Values() both construct (potentially very large) temporary arrays on the stack.
Maybe Haskell and F# can elide this kind of thing, but it's not something the Go compiler is going to do.
Maybe Haskell and F# can elide this kind of thing, but it's not something the Go compiler is going to do.