diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 5110e33109..3b22faf2fd 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -124,7 +124,7 @@ Running any of the above will build the latest changes and run tests against the ## Using your custom compiler to build this repository -By removing all the subfolders called `Proto` under `artifacts` and running the `build` script again, the proto compiler will include your changes. +By removing all the subfolders called `Bootstrap` or `Proto` under `artifacts` and running the `build` script again, the proto compiler will include your changes. Once the "proto" compiler is built, it won't be built again, so you may want to perform those steps again to ensure your changes don't break building the compiler itself. diff --git a/VisualFSharp.sln b/VisualFSharp.sln index b6e700de8c..c544239132 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -191,6 +191,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.Editor.IntegrationTe EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Benchmarks.Common", "tests\benchmarks\FSharp.Benchmarks.Common\FSharp.Benchmarks.Common.fsproj", "{6734FC6F-B5F3-45E1-9A72-720378BB49C9}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "MicroPerf", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\MicroPerf.fsproj", "{601CD5C1-EAFA-4AE3-8FB9-F667B5728213}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroPerfCSharp", "tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\CS\MicroPerfCSharp.csproj", "{9F9DD315-37DA-4413-928E-1CFC6924B64F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1005,6 +1009,30 @@ Global {6734FC6F-B5F3-45E1-9A72-720378BB49C9}.Release|Any CPU.Build.0 = Release|Any CPU {6734FC6F-B5F3-45E1-9A72-720378BB49C9}.Release|x86.ActiveCfg = Release|Any CPU {6734FC6F-B5F3-45E1-9A72-720378BB49C9}.Release|x86.Build.0 = Release|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Debug|Any CPU.Build.0 = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Debug|x86.ActiveCfg = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Debug|x86.Build.0 = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Proto|Any CPU.Build.0 = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Proto|x86.ActiveCfg = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Proto|x86.Build.0 = Debug|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Release|Any CPU.ActiveCfg = Release|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Release|Any CPU.Build.0 = Release|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Release|x86.ActiveCfg = Release|Any CPU + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213}.Release|x86.Build.0 = Release|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Debug|x86.ActiveCfg = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Debug|x86.Build.0 = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Proto|Any CPU.Build.0 = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Proto|x86.ActiveCfg = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Proto|x86.Build.0 = Debug|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Release|Any CPU.Build.0 = Release|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Release|x86.ActiveCfg = Release|Any CPU + {9F9DD315-37DA-4413-928E-1CFC6924B64F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1084,6 +1112,8 @@ Global {CBC96CC7-65AB-46EA-A82E-F6A788DABF80} = {F7876C9B-FB6A-4EFB-B058-D6967DB75FB2} {E31F9B59-FCF1-4D04-8762-C7BB60285A7B} = {F7876C9B-FB6A-4EFB-B058-D6967DB75FB2} {6734FC6F-B5F3-45E1-9A72-720378BB49C9} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B} + {601CD5C1-EAFA-4AE3-8FB9-F667B5728213} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B} + {9F9DD315-37DA-4413-928E-1CFC6924B64F} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index fc3b101381..42793d2688 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -1,5 +1,6 @@ ### Fixed +* Fix a false positive of the `[]` analysis in combination with `yield!`. ([PR #16933](https://github.com/dotnet/fsharp/pull/16933)) * Don't blow the stack when traversing deeply nested sequential expressions. ([PR #16882](https://github.com/dotnet/fsharp/pull/16882)) * Fix wrong range start of INTERP_STRING_END. ([PR #16774](https://github.com/dotnet/fsharp/pull/16774), [PR #16785](https://github.com/dotnet/fsharp/pull/16785)) * Fix missing warning for recursive calls in list comprehensions. ([PR #16652](https://github.com/dotnet/fsharp/pull/16652)) @@ -35,6 +36,7 @@ * Parser recovers on complex primary constructor patterns, better tree representation for primary constructor patterns. ([PR #16425](https://github.com/dotnet/fsharp/pull/16425)) * Name resolution: keep type vars in subsequent checks ([PR #16456](https://github.com/dotnet/fsharp/pull/16456)) * Higher-order-function-based API for working with the untyped abstract syntax tree. ([PR #16462](https://github.com/dotnet/fsharp/pull/16462)) +* PrettyNaming: make `DoesIdentifierNeedBackticks` public ([PR #16613](https://github.com/dotnet/fsharp/pull/16613)) * Add switch to generate types and members with IL visibility that accurately represents their F# visibility. ([PR #15484](https://github.com/dotnet/fsharp/pull/15484) * Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473)) * Symbols: Add GenericArguments to FSharpEntity ([PR #16470](https://github.com/dotnet/fsharp/pull/16470)) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2a15203d14..53c1706c21 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,9 +30,9 @@ - + https://github.com/dotnet/arcade - 8e3e00a76f467cc262dc14f6466ab884b2c4eb96 + 48e9e0d2164de0535446809364724da8962123a6 diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index a2709d1056..1f035fee73 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -128,7 +128,7 @@ jobs: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - - task: MicroBuildSigningPlugin@3 + - task: MicroBuildSigningPlugin@4 displayName: Install MicroBuild plugin inputs: signType: $(_SignType) @@ -136,6 +136,7 @@ jobs: feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json env: TeamName: $(_TeamName) + MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)' continueOnError: ${{ parameters.continueOnError }} condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) diff --git a/global.json b/global.json index ce5f7cf586..eb5b947f6e 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.0.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24170.6", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24176.8", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs index aaeec0e81d..97bdc05680 100644 --- a/src/Compiler/Checking/TailCallChecks.fs +++ b/src/Compiler/Checking/TailCallChecks.fs @@ -222,6 +222,13 @@ and CheckCall cenv args ctxts (tailCall: TailCall) = | Expr.App _ -> Some(TailCall.YesFromExpr cenv.g e) | IsAppInLambdaBody t -> Some t | _ -> None + | Expr.App(args = args) -> + args + |> List.tryPick (fun a -> + match a with + | IsAppInLambdaBody t -> Some t + | _ -> None) + | _ -> None // if we haven't already decided this is no tail call, try to detect CPS-like expressions diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fsi b/src/Compiler/SyntaxTree/PrettyNaming.fsi index 05478070e1..511f60b905 100644 --- a/src/Compiler/SyntaxTree/PrettyNaming.fsi +++ b/src/Compiler/SyntaxTree/PrettyNaming.fsi @@ -58,7 +58,7 @@ val IsIdentifierName: name: string -> bool /// TBD: needs unit testing val IsActivePatternName: name: string -> bool -val internal DoesIdentifierNeedBackticks: string -> bool +val DoesIdentifierNeedBackticks: string -> bool /// Adds double backticks if necessary to make a valid identifier, e.g. /// op_Addition --> op_Addition diff --git a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props index 8cc3ba76eb..792df8e235 100644 --- a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -30,7 +30,14 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - false + false + + false diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs index 92f2f30b14..592b3ac09e 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs @@ -59,7 +59,7 @@ module flaterrors = [] //Invalid case [] //Even more invalid case - [] // no + allowed + [] // no + allowed [] // no - allowed [] let ``E_MultiLine04_fs`` (option: string) = diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs index 9d34b2466e..e3ff4102f7 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs @@ -1522,3 +1522,164 @@ namespace N Message = "The member or function 'reverse' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } ] + + [] + let ``Don't warn for yield! call of rec func in seq`` () = + """ +namespace N + +module M = + + type SynExpr = + | Sequential of expr1 : SynExpr * expr2 : SynExpr + | NotSequential + member _.Range = 99 + + type SyntaxNode = SynExpr of SynExpr + + type SyntaxVisitor () = member _.VisitExpr _ = None + + let visitor = SyntaxVisitor () + let dive expr range f = range, fun () -> Some expr + let traverseSynExpr _ expr = Some expr + + [] + let rec traverseSequentials path expr = + seq { + match expr with + | SynExpr.Sequential(expr1 = expr1; expr2 = SynExpr.Sequential _ as expr2) -> + yield dive expr expr.Range (fun expr -> visitor.VisitExpr(path, traverseSynExpr path, (fun _ -> None), expr)) + let path = SyntaxNode.SynExpr expr :: path + yield dive expr1 expr1.Range (traverseSynExpr path) + yield! traverseSequentials path expr2 // should not warn + + | _ -> + yield dive expr expr.Range (traverseSynExpr path) + } + """ + |> FSharp + |> withLangVersion80 + |> compile + |> shouldSucceed + + [] + let ``Warn for yield! call of rec func in list comprehension`` () = + """ +namespace N + +module M = + + type SynExpr = + | Sequential of expr1 : SynExpr * expr2 : SynExpr + | NotSequential + member _.Range = 99 + + type SyntaxNode = SynExpr of SynExpr + + type SyntaxVisitor () = member _.VisitExpr _ = None + + let visitor = SyntaxVisitor () + let dive expr range f = range, fun () -> Some expr + let traverseSynExpr _ expr = Some expr + + [] + let rec traverseSequentials path expr = + [ + match expr with + | SynExpr.Sequential(expr1 = expr1; expr2 = SynExpr.Sequential _ as expr2) -> + // It's a nested sequential expression. + // Visit it, but make defaultTraverse do nothing, + // since we're going to traverse its descendants ourselves. + yield dive expr expr.Range (fun expr -> visitor.VisitExpr(path, traverseSynExpr path, (fun _ -> None), expr)) + + // Now traverse its descendants. + let path = SyntaxNode.SynExpr expr :: path + yield dive expr1 expr1.Range (traverseSynExpr path) + yield! traverseSequentials path expr2 // should warn + + | _ -> + // It's not a nested sequential expression. + // Traverse it normally. + yield dive expr expr.Range (traverseSynExpr path) + ] + """ + |> FSharp + |> withLangVersion80 + |> compile + |> shouldFail + |> withResults [ + { Error = Warning 3569 + Range = { StartLine = 32 + StartColumn = 24 + EndLine = 32 + EndColumn = 54 } + Message = + "The member or function 'traverseSequentials' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } + ] + + [] + let ``Warn for yield! call of rec func in custom CE`` () = + """ +namespace N + +module M = + + type SynExpr = + | Sequential of expr1 : SynExpr * expr2 : SynExpr + | NotSequential + member _.Range = 99 + + type SyntaxNode = SynExpr of SynExpr + + type SyntaxVisitor () = member _.VisitExpr _ = None + + let visitor = SyntaxVisitor () + let dive expr range f = range, fun () -> Some expr + let traverseSynExpr _ expr = Some expr + + type ThingsBuilder() = + + member _.Yield(x) = [ x ] + + member _.Combine(currentThings, newThings) = currentThings @ newThings + + member _.Delay(f) = f () + + member _.YieldFrom(x) = x + + let things = ThingsBuilder() + + [] + let rec traverseSequentials path expr = + things { + match expr with + | SynExpr.Sequential(expr1 = expr1; expr2 = SynExpr.Sequential _ as expr2) -> + // It's a nested sequential expression. + // Visit it, but make defaultTraverse do nothing, + // since we're going to traverse its descendants ourselves. + yield dive expr expr.Range (fun expr -> visitor.VisitExpr(path, traverseSynExpr path, (fun _ -> None), expr)) + + // Now traverse its descendants. + let path = SyntaxNode.SynExpr expr :: path + yield dive expr1 expr1.Range (traverseSynExpr path) + yield! traverseSequentials path expr2 // should warn + + | _ -> + // It's not a nested sequential expression. + // Traverse it normally. + yield dive expr expr.Range (traverseSynExpr path) + } + """ + |> FSharp + |> withLangVersion80 + |> compile + |> shouldFail + |> withResults [ + { Error = Warning 3569 + Range = { StartLine = 43 + StartColumn = 17 + EndLine = 43 + EndColumn = 68 } + Message = + "The member or function 'traverseSequentials' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } + ] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index 03bd579f6a..21c1c0de20 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -96,7 +96,6 @@ let x = lb {1; 2; if true then 3;} [] [] - [] [] [] [] @@ -135,4 +134,4 @@ let _pythags = seqbuilder {{ code |> FSharp |> typecheck - |> shouldSucceed \ No newline at end of file + |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs index 4b85f0cd80..12b13b88be 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Scenarios.fs @@ -937,6 +937,30 @@ let v = 2 module B do ignore (match "" with | nameof X.Y.Z -> () | _ -> ()) +""" + (set [| 0 |]) + ] + scenario + "nameof type with generic parameters" + [ + sourceFile + "A.fs" + """ +namespace A + +module B = + module C = + type D = class end +""" + Set.empty + sourceFile + "Z.fs" + """ +module Z + +open System.Threading.Tasks + +let _ = nameof Task """ (set [| 0 |]) ] diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index ccebabe869..aa70fc6ea3 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -6049,6 +6049,7 @@ FSharp.Compiler.Syntax.ParserDetail: Int32 GetHashCode(System.Collections.IEqual FSharp.Compiler.Syntax.ParserDetail: Int32 Tag FSharp.Compiler.Syntax.ParserDetail: Int32 get_Tag() FSharp.Compiler.Syntax.ParserDetail: System.String ToString() +FSharp.Compiler.Syntax.PrettyNaming: Boolean DoesIdentifierNeedBackticks(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsActivePatternName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsCompilerGeneratedName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsIdentifierFirstCharacter(Char) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index ccebabe869..aa70fc6ea3 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -6049,6 +6049,7 @@ FSharp.Compiler.Syntax.ParserDetail: Int32 GetHashCode(System.Collections.IEqual FSharp.Compiler.Syntax.ParserDetail: Int32 Tag FSharp.Compiler.Syntax.ParserDetail: Int32 get_Tag() FSharp.Compiler.Syntax.ParserDetail: System.String ToString() +FSharp.Compiler.Syntax.PrettyNaming: Boolean DoesIdentifierNeedBackticks(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsActivePatternName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsCompilerGeneratedName(System.String) FSharp.Compiler.Syntax.PrettyNaming: Boolean IsIdentifierFirstCharacter(Char) diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Benchmarks.fs b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Benchmarks.fs deleted file mode 100644 index cce0973913..0000000000 --- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Benchmarks.fs +++ /dev/null @@ -1,11 +0,0 @@ -namespace MicroPerf - -open BenchmarkDotNet.Running - -module Main = - - [] - let main args = - printfn "Running benchmarks..." - BenchmarkSwitcher.FromAssembly(typeof.Assembly).Run(args) |> ignore - 0 diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/ComputedCollections/Arrays/IntegralRanges.fs b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/ComputedCollections/Arrays/IntegralRanges.fs new file mode 100644 index 0000000000..645ce31c64 --- /dev/null +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/ComputedCollections/Arrays/IntegralRanges.fs @@ -0,0 +1,653 @@ +module MicroPerf.ComputedCollections.Arrays.IntegralRanges + +open BenchmarkDotNet.Attributes + +#nowarn "77" + +let inline (~~) x = (^a : (static member op_Explicit : int -> ^a) x) + +module All = + let inline ``[|start..finish|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : comparison> + (start : 'a) (finish : 'a) + = + [|start..finish|] + + let inline ``[|start..step..finish|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member One : 'a) + and 'a : comparison> + (start : 'a) (step : 'a) (finish : 'a) + = + [|start..step..finish|] + + let inline ``[|for n in start..finish -> n|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : comparison> + (start : 'a) (finish : 'a) + = + [|for n in start..finish -> n|] + + let inline ``[|for n in start..step..finish -> n|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member One : 'a) + and 'a : comparison> + (start : 'a) (step : 'a) (finish : 'a) + = + [|for n in start..step..finish -> n|] + + let inline ``[|1..127|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : comparison + and 'a : (static member op_Explicit : int -> 'a)> () = + ``[|start..finish|]``<'a> ~~1 ~~127 + + let inline ``[|1..2..127|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member One : 'a) + and 'a : (static member op_Explicit : int -> 'a) + and 'a : comparison> () = + ``[|start..step..finish|]``<'a> ~~1 ~~2 ~~127 + + let inline ``[|127..1|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : comparison + and 'a : (static member op_Explicit : int -> 'a)> () = + ``[|start..finish|]``<'a> ~~127 ~~1 + + let inline ``[|127..2..1|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member One : 'a) + and 'a : (static member op_Explicit : int -> 'a) + and 'a : comparison> () = + ``[|start..step..finish|]``<'a> ~~127 ~~2 ~~1 + + let inline ``[|1..32767|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : comparison + and 'a : (static member op_Explicit : int -> 'a)> () = + ``[|start..finish|]``<'a> ~~1 ~~32767 + + let inline ``[|1..2..32767|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member One : 'a) + and 'a : (static member op_Explicit : int -> 'a) + and 'a : comparison> () = + ``[|start..step..finish|]``<'a> ~~1 ~~2 ~~32767 + +module Signed = + let inline ``[|127..-1..-128|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member (~-) : 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member op_Explicit : int -> 'a) + and 'a : comparison> () = + All.``[|start..step..finish|]``<'a> ~~127 (- ~~1) (- ~~128) + + let inline ``[|127..-2..-128|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member (~-) : 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member op_Explicit : int -> 'a) + and 'a : comparison> () = + All.``[|start..step..finish|]``<'a> ~~127 (- ~~2) (- ~~128) + + let inline ``[|32767..-1..-32768|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member (~-) : 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member op_Explicit : int -> 'a) + and 'a : comparison> () = + All.``[|start..step..finish|]``<'a> ~~32767 (- ~~1) (- ~~32768) + + let inline ``[|32767..-2..-32768|]``<'a + when 'a : (static member (+) : 'a * 'a -> 'a) + and 'a : (static member (~-) : 'a -> 'a) + and 'a : (static member One : 'a) + and 'a : (static member Zero : 'a) + and 'a : (static member op_Explicit : int -> 'a) + and 'a : comparison> () = + All.``[|start..step..finish|]``<'a> ~~32767 (- ~~2) (- ~~32769) + +[] +type ComputedCollections_Arrays_IntegralRanges_SByte () = + member _.StartFinish : obj array seq = + [ + [|-128y; 127y|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|127y; -1y; -128y|] + [|-128y; 2y; 127y|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = Signed.``[|127..-1..-128|]`` () + + [] + member _.M6 () = Signed.``[|127..-2..-128|]`` () + + [] + [.StartFinish)>] + member _.M7 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M8 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_Byte () = + member _.StartFinish : obj array seq = + [ + [|box 0uy; 255uy|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|box 0uy; 2uy; 255uy|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + [.StartFinish)>] + member _.M5 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M6 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M7 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M8 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_Char () = + member _.StartFinish : obj array seq = + [ + [|'\000'; '\u7fff'|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|'\000'; '\002'; '\u7fff'|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + [.StartFinish)>] + member _.M7 (start : char) finish = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M8 (start : char) step finish = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M9 (start : char) finish = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M10 (start : char) step finish = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_Int16 () = + member _.StartFinish : obj array seq = + [ + [|-32768s; 32767s|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|32767s; -1s; -32768s|] + [|-32768s; 2s; 32767s|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + member _.M7 () = Signed.``[|32767..-1..-32768|]`` () + + [] + member _.M8 () = Signed.``[|32767..-2..-32768|]`` () + + [] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M11 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M12 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_UInt16 () = + member _.StartFinish : obj array seq = + [ + [|box 0us; 32767us|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|box 0us; 2us; 32767us|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + [.StartFinish)>] + member _.M7 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M8 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_Int32 () = + member _.StartFinish : obj array seq = + [ + [|-32768; 32767|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|32767; -1; -32768|] + [|-32768; 2; 32767|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + member _.M7 () = Signed.``[|32767..-1..-32768|]`` () + + [] + member _.M8 () = Signed.``[|32767..-2..-32768|]`` () + + [] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M11 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M12 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_UInt32 () = + member _.StartFinish : obj array seq = + [ + [|0u; 32767u|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|0u; 2u; 32767u|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + [.StartFinish)>] + member _.M7 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M8 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_Int64 () = + member _.StartFinish : obj array seq = + [ + [|-32768L; 32767L|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|32767L; -1L; -32768L|] + [|-32768L; 2L; 32767L|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + member _.M7 () = Signed.``[|32767..-1..-32768|]`` () + + [] + member _.M8 () = Signed.``[|32767..-2..-32768|]`` () + + [] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M11 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M12 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_UInt64 () = + member _.StartFinish : obj array seq = + [ + [|0UL; 32767UL|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|0UL; 2UL; 32767UL|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + [.StartFinish)>] + member _.M7 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M8 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_IntPtr () = + member _.StartFinish : obj array seq = + [ + [|-32768n; 32767n|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|32767n; -1n; -32768n|] + [|-32768n; 2n; 32767n|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + member _.M7 () = Signed.``[|32767..-1..-32768|]`` () + + [] + member _.M8 () = Signed.``[|32767..-2..-32768|]`` () + + [] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M11 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M12 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish + +[] +type ComputedCollections_Arrays_IntegralRanges_UIntPtr () = + member _.StartFinish : obj array seq = + [ + [|0un; 32767un|] + ] + + member _.StartStepFinish : obj array seq = + [ + [|0un; 2un; 32767un|] + ] + + [] + member _.M1 () = All.``[|127..1|]`` () + + [] + member _.M2 () = All.``[|127..2..1|]`` () + + [] + member _.M3 () = All.``[|1..127|]`` () + + [] + member _.M4 () = All.``[|1..2..127|]`` () + + [] + member _.M5 () = All.``[|1..32767|]`` () + + [] + member _.M6 () = All.``[|1..2..32767|]`` () + + [] + [.StartFinish)>] + member _.M7 (start, finish) = All.``[|start..finish|]`` start finish + + [] + [.StartStepFinish)>] + member _.M8 (start, step, finish) = All.``[|start..step..finish|]`` start step finish + + [ n|]")>] + [.StartFinish)>] + member _.M9 (start, finish) = All.``[|for n in start..finish -> n|]`` start finish + + [ n|]")>] + [.StartStepFinish)>] + member _.M10 (start, step, finish) = All.``[|for n in start..step..finish -> n|]`` start step finish diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj index 9fc704b2ce..2cbfaf0aab 100644 --- a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/MicroPerf.fsproj @@ -1,14 +1,20 @@  + Exe - $(OtherFlags) --nowarn:1204 - $(OtherFlags) --nowarn:57 - $(OtherFlags) --langversion:preview - $(OtherFlags) --define:PREVIEW + $(NoWarn);1204;57 + true + + + $(MSBuildThisFileDirectory)../../../../artifacts/bin/fsc/Release/$(TargetFramework)/fsc.dll + preview + + + @@ -21,9 +27,22 @@ - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Program.fs b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Program.fs new file mode 100644 index 0000000000..574f186dd3 --- /dev/null +++ b/tests/benchmarks/CompiledCodeBenchmarks/MicroPerf/Program.fs @@ -0,0 +1,16 @@ +module MicroPerf.Program + +open System +open System.Reflection +open BenchmarkDotNet.Configs +open BenchmarkDotNet.Jobs +open BenchmarkDotNet.Running + +let config = + DefaultConfig.Instance + .AddJob(Job.Default.WithId("Current").WithArguments([|MsBuildArgument "/p:BUILDING_USING_DOTNET=true"|]).AsBaseline()) + .AddJob(Job.Default.WithId("Preview").WithArguments([|MsBuildArgument "/p:BUILDING_USING_DOTNET=true"|]).WithCustomBuildConfiguration "Preview") + .WithOptions(ConfigOptions.JoinSummary) + .HideColumns("BuildConfiguration") + +ignore (BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(Environment.GetCommandLineArgs(), config)) diff --git a/tests/benchmarks/CompiledCodeBenchmarks/README.md b/tests/benchmarks/CompiledCodeBenchmarks/README.md new file mode 100644 index 0000000000..80ccf5eba9 --- /dev/null +++ b/tests/benchmarks/CompiledCodeBenchmarks/README.md @@ -0,0 +1,58 @@ +# Compiled Code Benchmarks + +This benchmarks project is meant to be used to test the performance of code generated by the F# compiler. It is set up so that, by default, it will build and run your benchmarks in two jobs: + +- The first will be built using the local compiler targeting the current language version and will be used as the baseline. +- The second will be built using the local compiler targeting the `preview` language version. + +Note that the intent is generally that you use this project to benchmark your changes locally. Most of the time, you will not need to check in your benchmarks. + +#### Build the repo with the `Release` config + +```pwsh +./Build.cmd -c Release +``` + +#### Run the benchmarks + +```pwsh +dotnet run --project .\tests\benchmarks\CompiledCodeBenchmarks\MicroPerf\MicroPerf.fsproj -c Release +``` + +The benchmark switcher will prompt you to choose which benchmark or benchmarks you want to run. + +#### Sample output + +```console +| Job | Categories | start | finish | step | Mean | Error | StdDev | Median | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio | +|-------- |--------------------------------------------------------------------------------------- |------ |------- |----- |---------------:|--------------:|--------------:|---------------:|------:|--------:|-------:|-------:|-------:|----------:|------------:| +| Current | UInt32,[|127u..1u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 24.046 ns | 0.4269 ns | 0.3993 ns | 23.985 ns | 1.00 | 0.00 | 0.0004 | - | - | 96 B | 1.00 | +| Preview | UInt32,[|127u..1u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 1.729 ns | 0.0804 ns | 0.0752 ns | 1.725 ns | 0.07 | 0.00 | - | - | - | - | 0.00 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|127u..2u..1u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 22.817 ns | 0.2053 ns | 0.1920 ns | 22.760 ns | 1.00 | 0.00 | 0.0004 | - | - | 96 B | 1.00 | +| Preview | UInt32,[|127u..2u..1u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 3.161 ns | 0.1053 ns | 0.0985 ns | 3.172 ns | 0.14 | 0.00 | - | - | - | - | 0.00 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|1u..127u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 361.493 ns | 4.3161 ns | 3.8261 ns | 361.798 ns | 1.00 | 0.00 | 0.0072 | - | - | 1768 B | 1.00 | +| Preview | UInt32,[|1u..127u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 96.560 ns | 1.9609 ns | 3.6347 ns | 94.721 ns | 0.27 | 0.01 | 0.0021 | - | - | 536 B | 0.30 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|1u..2u..127u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 263.240 ns | 3.4600 ns | 2.8893 ns | 264.086 ns | 1.00 | 0.00 | 0.0029 | - | - | 712 B | 1.00 | +| Preview | UInt32,[|1u..2u..127u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 58.053 ns | 1.1757 ns | 1.6481 ns | 57.840 ns | 0.22 | 0.01 | 0.0011 | - | - | 280 B | 0.39 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|1u..2u..32767u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 40,529.790 ns | 272.6267 ns | 241.6764 ns | 40,486.288 ns | 1.00 | 0.00 | 0.4883 | - | - | 131464 B | 1.00 | +| Preview | UInt32,[|1u..2u..32767u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 7,787.907 ns | 152.9334 ns | 176.1183 ns | 7,737.320 ns | 0.19 | 0.00 | 0.2747 | - | - | 65560 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|1u..32767u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 256,084.235 ns | 5,074.6636 ns | 6,598.4961 ns | 257,729.980 ns | 1.00 | 0.00 | 8.3008 | 8.3008 | 8.3008 | 393680 B | 1.00 | +| Preview | UInt32,[|1u..32767u|],ComputedCollections,Arrays,IntegralRanges | ? | ? | ? | 77,660.979 ns | 1,541.8822 ns | 4,399.0768 ns | 77,866.278 ns | 0.31 | 0.02 | 2.8076 | 2.8076 | 2.8076 | 131088 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|for n in start..finish -> n|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | ? | 281,373.636 ns | 5,097.5675 ns | 4,518.8608 ns | 282,881.763 ns | 1.00 | 0.00 | 8.7891 | 8.7891 | 8.7891 | 393741 B | 1.00 | +| Preview | UInt32,[|for n in start..finish -> n|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | ? | 77,629.964 ns | 1,545.8980 ns | 4,509.4572 ns | 77,968.518 ns | 0.29 | 0.02 | 3.0518 | 3.0518 | 3.0518 | 131090 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|for n in start..step..finish -> n|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | 2 | 69,948.064 ns | 1,078.6284 ns | 1,154.1203 ns | 69,834.222 ns | 1.00 | 0.00 | 0.7324 | - | - | 197056 B | 1.00 | +| Preview | UInt32,[|for n in start..step..finish -> n|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | 2 | 7,700.286 ns | 115.4058 ns | 107.9507 ns | 7,679.921 ns | 0.11 | 0.00 | 0.2747 | - | - | 65560 B | 0.33 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|start..finish|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | ? | 148,726.931 ns | 2,956.8132 ns | 4,603.4019 ns | 148,672.632 ns | 1.00 | 0.00 | 4.8828 | 4.3945 | 4.3945 | 262584 B | 1.00 | +| Preview | UInt32,[|start..finish|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | ? | 77,915.564 ns | 1,554.2518 ns | 3,476.3069 ns | 77,861.060 ns | 0.52 | 0.03 | 4.0283 | 4.0283 | 4.0283 | 131095 B | 0.50 | +| | | | | | | | | | | | | | | | | +| Current | UInt32,[|start..step..finish|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | 2 | 38,456.304 ns | 682.2118 ns | 638.1413 ns | 38,380.719 ns | 1.00 | 0.00 | 0.4883 | - | - | 131464 B | 1.00 | +| Preview | UInt32,[|start..step..finish|],ComputedCollections,Arrays,IntegralRanges | 0 | 32767 | 2 | 7,791.339 ns | 93.7728 ns | 87.7152 ns | 7,789.114 ns | 0.20 | 0.00 | 0.2747 | - | - | 65560 B | 0.50 | +``` \ No newline at end of file diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj index 4c66d9cfb8..d23efc28b9 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj @@ -3,6 +3,7 @@ Exe false + true diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 56f95a12ba..5510d3dcb9 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -10,7 +10,6 @@ true true true - false false nunit true