Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ indent_size = 2
[*.{yml,yaml}]
indent_size = 2
indent_style = space


# C# analyzers
[*.{cs,vb}]
dotnet_diagnostic.CA2252.severity = none
13 changes: 11 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>


<PropertyGroup>
<NET6_0_OR_GREATER Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)','net6.0'))">true</NET6_0_OR_GREATER>
<NET9_0_OR_GREATER Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)','net9.0'))">true</NET9_0_OR_GREATER>
<NET10_0_OR_GREATER Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)','net10.0'))">true</NET10_0_OR_GREATER>
</PropertyGroup>

<PropertyGroup Condition=" '$(MSBuildProjectExtension)' == '.fsproj'">
<DisableImplicitFSharpCoreReference>True</DisableImplicitFSharpCoreReference>
<LangVersion>8.0</LangVersion>
<LangVersion Condition="'$(TargetFramework)' == 'net9.0'">9.0</LangVersion>
<Nullable Condition="'$(TargetFramework)' == 'net9.0'">enable</Nullable>
<LangVersion Condition="'$(NET9_0_OR_GREATER)' == 'true'">9.0</LangVersion>
<Nullable Condition="'$(NET9_0_OR_GREATER)' == 'true'">enable</Nullable>
<LangVersion Condition="'$(NET10_0_OR_GREATER)' == 'true'">10.0</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
Expand All @@ -35,4 +43,5 @@
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0"/>

<!-- Benchmarks -->
<PackageVersion Include="BenchmarkDotNet" Version="0.13.9"/>
<PackageVersion Include="BenchmarkDotNet" Version="0.15.7"/>
<PackageVersion Include="Ply" Version="0.3.1"/>

<!-- Test -->
Expand Down
15 changes: 15 additions & 0 deletions IcedTasks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{B3
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ILSpySamples", "examples\ILSpySamples\ILSpySamples.fsproj", "{130D8BDE-DAB6-4B12-925D-A9CFEC9F8B02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpySamples-CSharp", "examples\ILSpySamples-CSharp\ILSpySamples-CSharp.csproj", "{F079E375-8A7E-4AF4-B89F-E0365682EEA6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -133,6 +135,18 @@ Global
{130D8BDE-DAB6-4B12-925D-A9CFEC9F8B02}.Release|x64.Build.0 = Release|Any CPU
{130D8BDE-DAB6-4B12-925D-A9CFEC9F8B02}.Release|x86.ActiveCfg = Release|Any CPU
{130D8BDE-DAB6-4B12-925D-A9CFEC9F8B02}.Release|x86.Build.0 = Release|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Debug|x64.ActiveCfg = Debug|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Debug|x64.Build.0 = Debug|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Debug|x86.ActiveCfg = Debug|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Debug|x86.Build.0 = Debug|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Release|Any CPU.Build.0 = Release|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Release|x64.ActiveCfg = Release|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Release|x64.Build.0 = Release|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Release|x86.ActiveCfg = Release|Any CPU
{F079E375-8A7E-4AF4-B89F-E0365682EEA6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -145,5 +159,6 @@ Global
{446B1378-DDC2-47CD-A6F2-C10F946B7E12} = {ACBEE43C-7A88-4FB1-9B06-DB064D22B29F}
{04D5314E-2B8F-442B-9983-DCD12CC43448} = {ACBEE43C-7A88-4FB1-9B06-DB064D22B29F}
{130D8BDE-DAB6-4B12-925D-A9CFEC9F8B02} = {B36A84DF-456D-A817-6EDD-3EC3E7F6E11F}
{F079E375-8A7E-4AF4-B89F-E0365682EEA6} = {B36A84DF-456D-A817-6EDD-3EC3E7F6E11F}
EndGlobalSection
EndGlobal
5 changes: 4 additions & 1 deletion benchmarks/CSharpTaskBenchmarks/CSharpTaskBenchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<Features>$(Features);runtime-async=on</Features>
<NoWarn>$(NoWarn);SYSLIB5007</NoWarn>
</PropertyGroup>
</Project>
35 changes: 35 additions & 0 deletions benchmarks/FSharpBenchmarks/AsynchonousCompletionBenchmark.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ open System.Threading.Tasks
open IcedTasks

open System.IO
open System.Runtime.CompilerServices


[<AutoOpen>]
Expand Down Expand Up @@ -82,7 +83,25 @@ module AsyncHelpers =
do! taskYield ()
return 100
}
#if NET10_0_OR_GREATER
[<MethodImpl(MethodImplOptions.Async)>]

// [<MethodImpl(8192s)>]
let fsharp_tenBindAsync_TaskBuilderRuntime () =
IcedTasks.Polyfill.TasksRuntime.TaskBuilder.task {
do! taskYield ()
do! taskYield ()
do! taskYield ()
do! taskYield ()
do! taskYield ()
do! taskYield ()
do! taskYield ()
do! taskYield ()
do! taskYield ()
do! taskYield ()
return 100
}
#endif

let fsharp_tenBindAsync_ValueTaskBuilder () =
valueTask {
Expand Down Expand Up @@ -233,6 +252,22 @@ type AsyncCompletionBenchmarks() =

z


[<BenchmarkCategory(AsyncBinds, fsharp, taskBuilderRuntime);
Benchmark(OperationsPerInvoke = manyIterationsConst)>]
member x.FSharp_TenBindsAsync_TaskBuilderRuntime() : int =
#if NET10_0_OR_GREATER
let mutable z = 0

for i in 1 .. x.manyIterations do
z <- fsharp_tenBindAsync_TaskBuilderRuntime().GetAwaiter().GetResult()


z
#else
raise (NotSupportedException("Must be .NET 10 or greater"))
#endif

[<BenchmarkCategory(AsyncBinds, fsharp, valueTaskBuilder);
Benchmark(OperationsPerInvoke = manyIterationsConst)>]
member x.FSharp_TenBindsAsync_ValueTaskBuilder() =
Expand Down
Loading
Loading