You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure whether this might be F# imporvement or JIT.. Basically I will duplicate this in runtime repo (dotnet/runtime#58941) too.
Consider these 2 methods:
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]letfold initial folder (enumerator:#IEnumerator<'i>)=letfolder= OptimizedClosures.FSharpFunc<_,_,_>.Adapt folder
let mutableenumerator= enumerator
let mutableresult= initial
while enumerator.MoveNext()do
result <- folder.Invoke(result, enumerator.Current)
result
While difference might be non obvious, C# version with condition at the end of the method results in 10-15% perf imporvement while having the same assembly size.
Can F# compiler emit better IL here?
The text was updated successfully, but these errors were encountered:
I'm not sure whether this might be F# imporvement or JIT.. Basically I will duplicate this in runtime repo (dotnet/runtime#58941) too.
Consider these 2 methods:
They look very similar but there is an importnat il emit difference:
C# method is compiled to this basically:
While F# is compiled to this basically:
While difference might be non obvious, C# version with condition at the end of the method results in 10-15% perf imporvement while having the same assembly size.
Can F# compiler emit better IL here?
The text was updated successfully, but these errors were encountered: