Tuomas Hietanen

Results 503 comments of Tuomas Hietanen

I did some initial tests to see if this makes sense at all or not. I used the current `benchmarks\CompiledCodeBenchmarks\MicroPerf\MicroPerf.fsproj` with adding following tests: ```fsharp [] member x.ArraySum() = //...

> The IL for Enumerable is very complicated, and is heavily relying on the JIT to simplify it. In Release mode, I observe Enumerable to take half the time; in...

> Better try without the mapping step for fully prove that. I did check this, and the results were worse for Enumerable.Sum Main - current | Method | Job |...

Because this is just a forwarding, behaviour difference is easy to explore already in FSI: ```fsharp [| 1.; Double.NaN |] |> Array.sum;; //val it: float = nan [| 1.; Double.NaN...

> What are the numbers when running on the full clr? 4.6-4.8? Enumerable probably has different implementation there. I don't know how to easily run MicroPerf.fsproj in .NET, but I...

The `IEnumerable.Sum` of NET 9 checks the support for vectors via `Vector.IsSupported` and `Vector.IsHardwareAccelerated`. But I assume there is not even a type of `System.Numerics.Vector` in .NET Framework 4.8. /...

> And switching at runtime Runtime check added. Compared to this https://github.com/dotnet/fsharp/pull/18509#issuecomment-2833350985 ...this PR Array.sum still beats the current main over 50%: This PR: | Method | Job | Arguments...

After `Sum` is solved, I guess it's time for `SumBy` to do the same, because SumBy is the more commonly used in F#. There is System.Linq.Enumerable.Sum overload that takes a...

Oh, you are right, it isn't. That's sad, makes this very marginal feature especially when tools like FSharpLint prefer sumBy over (map >> sum)

> However they will be defined on both net48 and net9.0 .NET Framework is not .NET Standard 2.1 compatible, thus .NET Standard 2.1 version shouldn't need runtime check. I expect...