Explorar el Código

FSharp updates (#4009)

Ben Adams hace 7 años
padre
commit
5ee28b6348

+ 6 - 6
frameworks/FSharp/giraffe/src/App/App.fsproj

@@ -10,11 +10,11 @@
 
   <ItemGroup>
     <PackageReference Include="Dapper" Version="1.50.5" />
-    <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.0" />
-    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.0" />
-    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.0" />
-    <PackageReference Include="Giraffe" Version="1.1.0" />
-    <PackageReference Include="Npgsql" Version="4.0.0" />
+    <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.1" />
+    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.2" />
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
+    <PackageReference Include="Giraffe" Version="2.0.0" />
+    <PackageReference Include="Npgsql" Version="4.0.2" />
     <PackageReference Include="Utf8Json" Version="1.3.7" />
   </ItemGroup>
 
@@ -28,7 +28,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Update="FSharp.Core" Version="4.5.0" />
+    <PackageReference Update="FSharp.Core" Version="4.5.2" />
   </ItemGroup>
 
 </Project> 

+ 0 - 21
frameworks/FSharp/giraffe/src/Tests/BenchmarkTests.fsproj

@@ -1,21 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>netcoreapp2.1</TargetFramework>
-    <OutputType>Exe</OutputType>
-    <AssemblyName>BenchmarkTests</AssemblyName>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Compile Include="Program.fs" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
-    <PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="1.2.2" />
-    <ProjectReference Include="..\App\App.fsproj" />
-    <PackageReference Include="Giraffe" Version="1.1.0" /> 
-    <PackageReference Update="FSharp.Core" Version="4.5.0" />
-  </ItemGroup>
-
-</Project>

+ 0 - 89
frameworks/FSharp/giraffe/src/Tests/Program.fs

@@ -1,89 +0,0 @@
-module Program
-
-open App
-open BenchmarkDotNet.Attributes
-open BenchmarkDotNet.Running
-open BenchmarkDotNet.Configs
-open BenchmarkDotNet.Jobs
-open BenchmarkDotNet.Diagnosers
-open System.Text
-open System.IO
-open Microsoft.IO
-open System
-open Custom
-
-type FastAndDirty() as self =
-    inherit ManualConfig()
-    do 
-        let job = new Job("", RunMode.Short, InfrastructureMode.InProcess)
-        self.Add(job)
-        self.Add(DefaultConfig.Instance.GetLoggers() |> Array.ofSeq)
-        self.Add(DefaultConfig.Instance.GetColumnProviders() |> Array.ofSeq)
-        self.Add(DefaultConfig.Instance.GetAnalysers() |> Array.ofSeq)
-        self.Add(DefaultConfig.Instance.GetDiagnosers() |> Array.ofSeq)
-        self.Add([|MemoryDiagnoser() :> IDiagnoser|])
-
-let node () = HtmlViews.fortunes (
-    [
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = "Привет мир! Привет мир! Привет мир!" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = "Привет мир! Привет мир! Привет мир!" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = """<script>alert("This should not be displayed in a browser alert box.");</script>""" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = "Привет мир! Привет мир! Привет мир!" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = "Привет мир! Привет мир! Привет мир!" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = """<script>alert("This should not be displayed in a browser alert box.");</script>""" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = "Привет мир! Привет мир! Привет мир!" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = "Привет мир! Привет мир! Привет мир!" }
-        { id = 1; message = "Hello world! Hello world! Hello world!" }
-        { id = 1; message = """<script>alert("This should not be displayed in a browser alert box.");</script>""" }
-    ]) 
-
-let node' = node()
-
-type MemoryPoolBench () =
-    let pool = new RecyclableMemoryStreamManager();    
-
-    [<Benchmark(Baseline = true)>]
-    member self.NewMemoryStream () = 
-        let start = new MemoryStream()
-        let stream = StetefullRendering.renderHtmlToStream start node'
-        ()
-
-    [<Benchmark>]
-    member self.CustomPool() = 
-        let stream = MemoryStreamCache.Get()
-        StetefullRendering.renderHtmlToStream stream node'
-        MemoryStreamCache.Release stream
-        ()
-
-    [<Benchmark>]
-    member self.MSPool () = 
-        use start = pool.GetStream()
-        let stream = StetefullRendering.renderHtmlToStream start node'
-        ()
-
-type HtmlBench () =
-
-    [<Benchmark(Baseline = true)>]
-    member self.Standard () = 
-        let bytes = Giraffe.GiraffeViewEngine.renderHtmlDocument (node()) |> Encoding.UTF8.GetBytes
-        ()
-
-    [<Benchmark>]
-    member self.Custom () = 
-        let stream = MemoryStreamCache.Get()
-        StetefullRendering.renderHtmlToStream stream (node())
-        MemoryStreamCache.Release stream
-        ()
-
-[<EntryPoint>]
-let Main args =
-    let _ = BenchmarkRunner.Run<HtmlBench>(FastAndDirty())
-    0

+ 1 - 1
frameworks/FSharp/suave/benchmark_config.json

@@ -10,7 +10,7 @@
         "classification": "Micro",
         "database": "None",
         "framework": "Suave",
-        "language": "FSharp",
+        "language": "F#",
         "flavor": "None",
         "orm": "None",
         "platform": ".NET",