Browse Source

Updating to aspnetcore 2.1 RC (#3706)

Sébastien Ros 7 years ago
parent
commit
afa0ec6cff
71 changed files with 1014 additions and 483 deletions
  1. 2 0
      frameworks/CSharp/aspnetcore/.gitignore
  2. 5 14
      frameworks/CSharp/aspnetcore/Benchmarks/Benchmarks.csproj
  3. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Configuration/AppSettings.cs
  4. 4 2
      frameworks/CSharp/aspnetcore/Benchmarks/Configuration/DatabaseServer.cs
  5. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Configuration/Scenarios.cs
  6. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Controllers/MultipleQueriesController.cs
  7. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Controllers/MultipleUpdatesController.cs
  8. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Controllers/SingleQueryController.cs
  9. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Data/ApplicationDbContext.cs
  10. 0 97
      frameworks/CSharp/aspnetcore/Benchmarks/Data/ApplicationDbSeeder.cs
  11. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Data/BatchUpdateString.cs
  12. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Data/EfDb.cs
  13. 1 0
      frameworks/CSharp/aspnetcore/Benchmarks/Data/Fortune.cs
  14. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Data/IDb.cs
  15. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Data/Random.cs
  16. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Data/World.cs
  17. 0 93
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/DebugInfoPageMiddleware.cs
  18. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/FortunesEfMiddleware.cs
  19. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesEfMiddleware.cs
  20. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesEfMiddleware.cs
  21. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryEfMiddleware.cs
  22. 10 77
      frameworks/CSharp/aspnetcore/Benchmarks/Program.cs
  23. 12 17
      frameworks/CSharp/aspnetcore/Benchmarks/Startup.cs
  24. 4 0
      frameworks/CSharp/aspnetcore/Benchmarks/appsettings.mysql.json
  25. 2 2
      frameworks/CSharp/aspnetcore/Benchmarks/appsettings.postgresql.json
  26. 50 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/AsciiString.cs
  27. 157 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.cs
  28. 81 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs
  29. 93 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BufferWriter.cs
  30. 38 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BufferWriterExtensions.cs
  31. 59 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/DateHeader.cs
  32. 161 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/HttpApplication.cs
  33. 7 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/NuGet.Config
  34. 14 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/PlatformBenchmarks.csproj
  35. 46 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/Program.cs
  36. 19 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/Startup.cs
  37. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mvc-ado-my.dockerfile
  38. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mvc-ado-pg.dockerfile
  39. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mvc-dap-my.dockerfile
  40. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mvc-dap-pg.dockerfile
  41. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mvc-ef-pg.dockerfile
  42. 12 0
      frameworks/CSharp/aspnetcore/aspcore-mvc.dockerfile
  43. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mw-ado-my.dockerfile
  44. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mw-ado-pg.dockerfile
  45. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mw-dap-my.dockerfile
  46. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mw-dap-pg.dockerfile
  47. 13 0
      frameworks/CSharp/aspnetcore/aspcore-mw-ef-pg.dockerfile
  48. 12 0
      frameworks/CSharp/aspnetcore/aspcore-mw.dockerfile
  49. 12 0
      frameworks/CSharp/aspnetcore/aspcore.dockerfile
  50. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-middleware-dapper.dockerfile
  51. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-middleware-ef.dockerfile
  52. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-middleware-json.dockerfile
  53. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-middleware-raw.dockerfile
  54. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-mvc-dapper.dockerfile
  55. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-mvc-ef.dockerfile
  56. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-mvc-json.dockerfile
  57. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-mvc-raw.dockerfile
  58. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore-mvc.dockerfile
  59. 0 6
      frameworks/CSharp/aspnetcore/aspnetcore.dockerfile
  60. 68 41
      frameworks/CSharp/aspnetcore/benchmark_config.json
  61. 0 14
      frameworks/CSharp/aspnetcore/run-linux.sh
  62. 0 3
      frameworks/CSharp/aspnetcore/setup-dapper.sh
  63. 0 3
      frameworks/CSharp/aspnetcore/setup-ef.sh
  64. 0 3
      frameworks/CSharp/aspnetcore/setup-json.sh
  65. 0 3
      frameworks/CSharp/aspnetcore/setup-mvc-dapper.sh
  66. 0 3
      frameworks/CSharp/aspnetcore/setup-mvc-ef.sh
  67. 0 3
      frameworks/CSharp/aspnetcore/setup-mvc-json.sh
  68. 0 3
      frameworks/CSharp/aspnetcore/setup-mvc-plaintext.sh
  69. 0 3
      frameworks/CSharp/aspnetcore/setup-mvc-raw.sh
  70. 0 24
      frameworks/CSharp/aspnetcore/setup-plaintext.sh
  71. 0 3
      frameworks/CSharp/aspnetcore/setup-raw.sh

+ 2 - 0
frameworks/CSharp/aspnetcore/.gitignore

@@ -0,0 +1,2 @@
+*/bin
+*/obj

+ 5 - 14
frameworks/CSharp/aspnetcore/Benchmarks/Benchmarks.csproj

@@ -1,29 +1,20 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
   <PropertyGroup>
-    <TargetFramework>netcoreapp2.0</TargetFramework>
+    <TargetFramework>netcoreapp2.1</TargetFramework>
     <OutputType>Exe</OutputType>
-    <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
   </PropertyGroup>
 
   <ItemGroup>
     <None Update="wwwroot/**" CopyToOutputDirectory="PreserveNewest" />
     <None Include="appsettings.json" CopyToOutputDirectory="PreserveNewest" />
     <None Include="appsettings.postgresql.json" />
+    <None Include="appsettings.mysql.json" />
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="Microsoft.AspNetCore.App" />
     <PackageReference Include="Dapper" Version="1.50.4" />
-    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.2" />
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="2.0.2" />
-    <PackageReference Include="Microsoft.AspNetCore.Server.HttpSys" Version="2.0.2" />
-    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.1" />
-    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" />
-    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.1" />
-    <PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.0" />
-    <PackageReference Include="Npgsql" Version="3.2.7" />
-    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.0.1" />
+    <PackageReference Include="MySqlConnector" Version="0.40.3" />
+    <PackageReference Include="Npgsql" Version="4.0.0-preview2" />
   </ItemGroup>
 </Project>

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Configuration/AppSettings.cs

@@ -7,6 +7,6 @@ namespace Benchmarks.Configuration
     {
         public string ConnectionString { get; set; }
 
-        public DatabaseServer Database { get; set; } = DatabaseServer.SqlServer;
+        public DatabaseServer Database { get; set; } = DatabaseServer.None;
     }
 }

+ 4 - 2
frameworks/CSharp/aspnetcore/Benchmarks/Configuration/DatabaseServer.cs

@@ -6,7 +6,9 @@ namespace Benchmarks.Configuration
 {
     public enum DatabaseServer
     {
+        None,
         SqlServer,
-        PostgreSql
+        PostgreSql,
+        MySql
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Configuration/Scenarios.cs

@@ -164,4 +164,4 @@ namespace Benchmarks.Configuration
 
         public string[] Paths { get; }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Controllers/MultipleQueriesController.cs

@@ -39,4 +39,4 @@ namespace Benchmarks.Controllers
             return db.LoadMultipleQueriesRows(queries);
         }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Controllers/MultipleUpdatesController.cs

@@ -39,4 +39,4 @@ namespace Benchmarks.Controllers
             return db.LoadMultipleUpdatesRows(queries);
         }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Controllers/SingleQueryController.cs

@@ -38,4 +38,4 @@ namespace Benchmarks.Controllers
             return db.LoadSingleQueryRow();
         }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Data/ApplicationDbContext.cs

@@ -18,4 +18,4 @@ namespace Benchmarks.Data
 
         public DbSet<Fortune> Fortune { get; set; }
     }
-}
+}

+ 0 - 97
frameworks/CSharp/aspnetcore/Benchmarks/Data/ApplicationDbSeeder.cs

@@ -1,97 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Linq;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Benchmarks.Data
-{
-    public class ApplicationDbSeeder
-    {
-        private readonly object _locker = new object();
-        private readonly IRandom _random;
-        private readonly IServiceScopeFactory _serviceScopeFactory;
-        private bool _seeded = false;
-
-        public ApplicationDbSeeder(IRandom random, IServiceScopeFactory serviceScopeFactory)
-        {
-            _random = random;
-            _serviceScopeFactory = serviceScopeFactory;
-        }
-
-        public bool Seed()
-        {
-            if (!_seeded)
-            {
-                lock (_locker)
-                {
-                    if (!_seeded)
-                    {
-                        try
-                        {
-                            using (var serviceScope = _serviceScopeFactory.CreateScope())
-                            {
-                                var dbContext = serviceScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
-
-                                dbContext.Database.EnsureCreated();
-
-                                var world = dbContext.World.Count();
-                                var fortune = dbContext.Fortune.Count();
-
-                                if (world == 0 || fortune == 0)
-                                {
-                                    if (world == 0)
-                                    {
-                                        for (int i = 0; i < 10000; i++)
-                                        {
-                                            dbContext.World.Add(new World { RandomNumber = _random.Next(1, 10001) });
-                                        }
-                                        dbContext.SaveChanges();
-                                    }
-
-                                    if (fortune == 0)
-                                    {
-                                        dbContext.Fortune.Add(new Fortune { Message = "fortune: No such file or directory" });
-                                        dbContext.Fortune.Add(new Fortune { Message = "A computer scientist is someone who fixes things that aren't broken." });
-                                        dbContext.Fortune.Add(new Fortune { Message = "After enough decimal places, nobody gives a damn." });
-                                        dbContext.Fortune.Add(new Fortune { Message = "A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1" });
-                                        dbContext.Fortune.Add(new Fortune { Message = "A computer program does what you tell it to do, not what you want it to do." });
-                                        dbContext.Fortune.Add(new Fortune { Message = "Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen" });
-                                        dbContext.Fortune.Add(new Fortune { Message = "Any program that runs right is obsolete." });
-                                        dbContext.Fortune.Add(new Fortune { Message = "A list is only as strong as its weakest link. — Donald Knuth" });
-                                        dbContext.Fortune.Add(new Fortune { Message = "Feature: A bug with seniority." });
-                                        dbContext.Fortune.Add(new Fortune { Message = "Computers make very fast, very accurate mistakes." });
-                                        dbContext.Fortune.Add(new Fortune { Message = "<script>alert(\"This should not be displayed in a browser alert box.\");</script>" });
-                                        dbContext.Fortune.Add(new Fortune { Message = "フレームワークのベンチマーク" });
-
-                                        dbContext.SaveChanges();
-                                    }
-
-                                    Console.WriteLine("Database successfully seeded!");
-                                }
-                                else
-                                {
-                                    Console.WriteLine("Database already seeded!");
-                                }
-
-                                _seeded = true;
-                                return true;
-                            }
-                        }
-                        catch (Exception ex)
-                        {
-                            Console.Error.WriteLine("Error trying to seed the database");
-                            Console.Error.WriteLine(ex);
-
-                            return false;
-                        }
-                    }
-                }
-            }
-
-            Console.WriteLine("Database already seeded!");
-            return true;
-        }
-    }
-}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Data/BatchUpdateString.cs

@@ -21,4 +21,4 @@ namespace Benchmarks.Data
         public string Random { get; set; }
         public string UpdateQuery { get; set; }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Data/EfDb.cs

@@ -94,4 +94,4 @@ namespace Benchmarks.Data
             return result;
         }
     }
-}
+}

+ 1 - 0
frameworks/CSharp/aspnetcore/Benchmarks/Data/Fortune.cs

@@ -24,6 +24,7 @@ namespace Benchmarks.Data
 
         public int CompareTo(Fortune other)
         {
+            // Performance critical, using culture insensitive comparison
             return String.CompareOrdinal(Message, other.Message);
         }
     }

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Data/IDb.cs

@@ -16,4 +16,4 @@ namespace Benchmarks.Data
 
         Task<IEnumerable<Fortune>> LoadFortunesRows();
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Data/Random.cs

@@ -17,4 +17,4 @@ namespace Benchmarks.Data
             return _random.Value.Next(minValue, maxValue);
         }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Data/World.cs

@@ -14,4 +14,4 @@ namespace Benchmarks.Data
         [Column("randomnumber")]
         public int RandomNumber { get; set; }
     }
-}
+}

+ 0 - 93
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/DebugInfoPageMiddleware.cs

@@ -1,93 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Linq;
-using System.Runtime;
-using System.Threading.Tasks;
-using Benchmarks.Configuration;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Hosting.Server.Features;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Http.Features;
-
-namespace Benchmarks.Middleware
-{
-    public class DebugInfoPageMiddleware
-    {
-#if DEBUG
-        private static readonly string _configurationName = "Debug";
-#elif RELEASE
-        private static readonly string _configurationName = "Release";
-#else
-        private static readonly string _configurationName = "";
-#endif
-
-        private static readonly string _targetFrameworkName = AppContext.TargetFrameworkName;
-
-        private readonly IHostingEnvironment _hostingEnv;
-        private readonly RequestDelegate _next;
-        private readonly Scenarios _scenarios;
-        private readonly IServerAddressesFeature _serverAddresses;
-
-        public DebugInfoPageMiddleware(RequestDelegate next, IServerAddressesFeature serverAddresses, IHostingEnvironment hostingEnv, Scenarios scenarios)
-        {
-            _next = next;
-            _hostingEnv = hostingEnv;
-            _scenarios = scenarios;
-            _serverAddresses = serverAddresses;
-        }
-
-        public async Task Invoke(HttpContext httpContext)
-        {
-            httpContext.Response.ContentType = "text/html";
-            httpContext.Response.StatusCode = StatusCodes.Status404NotFound;
-
-            await httpContext.Response.WriteAsync("<!DOCTYPE html><html><head><style>body{font-family:\"Segoe UI\",Arial,Helvetica,Sans-serif};h1,h2,h3{font-family:\"Segoe UI Light\"}</style></head><body>");
-            await httpContext.Response.WriteAsync("<h1>ASP.NET Core Benchmarks</h1>");
-            await httpContext.Response.WriteAsync("<h2>Configuration Information</h2>");
-            await httpContext.Response.WriteAsync("<ul>");
-            await httpContext.Response.WriteAsync($"<li>Environment: {_hostingEnv.EnvironmentName}</li>");
-            await httpContext.Response.WriteAsync($"<li>Framework: {_targetFrameworkName}</li>");
-            await httpContext.Response.WriteAsync($"<li>Server GC enabled: {GCSettings.IsServerGC}</li>");
-            await httpContext.Response.WriteAsync($"<li>Configuration: {_configurationName}</li>");
-            await httpContext.Response.WriteAsync($"<li>Server: {Program.Server}</li>");
-            await httpContext.Response.WriteAsync($"<li>Server URLs: {string.Join(", ", _serverAddresses.Addresses)}</li>");
-            await httpContext.Response.WriteAsync($"<li>Supports Send File: {httpContext.Features.Get<IHttpSendFileFeature>() != null}</li>");
-
-            await httpContext.Response.WriteAsync($"<li>Server features:<ul>");
-            foreach (var feature in httpContext.Features)
-            {
-                await httpContext.Response.WriteAsync($"<li>{feature.Key.Name}</li>");
-            }
-            await httpContext.Response.WriteAsync($"</ul></li>");
-
-            await httpContext.Response.WriteAsync($"<li>Enabled scenarios:<ul>");
-            var enabledScenarios = _scenarios.GetEnabled();
-            var maxNameLength = enabledScenarios.Max(s => s.Name.Length);
-            foreach (var scenario in enabledScenarios)
-            {
-                await httpContext.Response.WriteAsync($"<li>{scenario.Name}<ul>");
-                foreach (var path in scenario.Paths)
-                {
-                    await httpContext.Response.WriteAsync($"<li><a href=\"{path}\">{path}</a></li>");
-                }
-                await httpContext.Response.WriteAsync($"</ul></li>");
-            }
-            await httpContext.Response.WriteAsync($"</ul></li>");
-
-
-            await httpContext.Response.WriteAsync("</ul>");
-            await httpContext.Response.WriteAsync("</body></html>");
-        }
-    }
-
-    public static class DebugInfoPageMiddlewareExtensions
-    {
-        public static IApplicationBuilder RunDebugInfoPage(this IApplicationBuilder builder)
-        {
-            return builder.UseMiddleware<DebugInfoPageMiddleware>(builder.ServerFeatures.Get<IServerAddressesFeature>());
-        }
-    }
-}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/FortunesEfMiddleware.cs

@@ -48,4 +48,4 @@ namespace Benchmarks.Middleware
             return builder.UseMiddleware<FortunesEfMiddleware>();
         }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesEfMiddleware.cs

@@ -59,4 +59,4 @@ namespace Benchmarks.Middleware
             return builder.UseMiddleware<MultipleQueriesEfMiddleware>();
         }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesEfMiddleware.cs

@@ -59,4 +59,4 @@ namespace Benchmarks.Middleware
             return builder.UseMiddleware<MultipleUpdatesEfMiddleware>();
         }
     }
-}
+}

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryEfMiddleware.cs

@@ -56,4 +56,4 @@ namespace Benchmarks.Middleware
             return builder.UseMiddleware<SingleQueryEfMiddleware>();
         }
     }
-}
+}

+ 10 - 77
frameworks/CSharp/aspnetcore/Benchmarks/Program.cs

@@ -16,7 +16,6 @@ namespace Benchmarks
     public class Program
     {
         public static string[] Args;
-        public static string Server;
 
         public static void Main(string[] args)
         {
@@ -35,8 +34,6 @@ namespace Benchmarks
                 .AddCommandLine(args)
                 .Build();
 
-            Server = config["server"] ?? "Kestrel";
-
             var webHostBuilder = new WebHostBuilder()
                 .UseContentRoot(Directory.GetCurrentDirectory())
                 .UseConfiguration(config)
@@ -47,91 +44,28 @@ namespace Benchmarks
                     .AddSingleton<Scenarios>()
                 )
                 .UseDefaultServiceProvider(
-                    (context, options) => options.ValidateScopes = context.HostingEnvironment.IsDevelopment());
+                    (context, options) => options.ValidateScopes = context.HostingEnvironment.IsDevelopment())
+                .UseKestrel();
+
+            var threadCount = GetThreadCount(config);
 
-            if (String.Equals(Server, "Kestrel", StringComparison.OrdinalIgnoreCase))
+            webHostBuilder.UseSockets(x =>
             {
-                var threads = GetThreadCount(config);
-                webHostBuilder = webHostBuilder.UseKestrel();
-                if (threads > 0)
+                if (threadCount > 0)
                 {
-                    webHostBuilder = webHostBuilder.UseLibuv(options => options.ThreadCount = threads);
+                    x.IOQueueCount = threadCount;
                 }
-            }
-            else if (String.Equals(Server, "HttpSys", StringComparison.OrdinalIgnoreCase))
-            {
-                webHostBuilder = webHostBuilder.UseHttpSys();
-            }
-            else
-            {
-                throw new InvalidOperationException($"Unknown server value: {Server}");
-            }
+
+                Console.WriteLine($"Using Sockets with {x.IOQueueCount} threads");
+            });
 
             var webHost = webHostBuilder.Build();
 
-            Console.WriteLine($"Using server {Server}");
             Console.WriteLine($"Server GC is currently {(GCSettings.IsServerGC ? "ENABLED" : "DISABLED")}");
 
-            var nonInteractiveValue = config["NonInteractive"];
-            if (nonInteractiveValue == null || !bool.Parse(nonInteractiveValue))
-            {
-                StartInteractiveConsoleThread();
-            }
-
             webHost.Run();
         }
 
-        private static void StartInteractiveConsoleThread()
-        {
-            // Run the interaction on a separate thread as we don't have Console.KeyAvailable on .NET Core so can't
-            // do a pre-emptive check before we call Console.ReadKey (which blocks, hard)
-
-            var started = new ManualResetEvent(false);
-
-            var interactiveThread = new Thread(() =>
-            {
-                Console.WriteLine("Press 'C' to force GC or any other key to display GC stats");
-                Console.WriteLine();
-
-                started.Set();
-
-                while (true)
-                {
-                    var key = Console.ReadKey(intercept: true);
-
-                    if (key.Key == ConsoleKey.C)
-                    {
-                        Console.WriteLine();
-                        Console.Write("Forcing GC...");
-                        GC.Collect();
-                        GC.WaitForPendingFinalizers();
-                        GC.Collect();
-                        Console.WriteLine(" done!");
-                    }
-                    else
-                    {
-                        Console.WriteLine();
-                        Console.WriteLine($"Allocated: {GetAllocatedMemory()}");
-                        Console.WriteLine($"Gen 0: {GC.CollectionCount(0)}, Gen 1: {GC.CollectionCount(1)}, Gen 2: {GC.CollectionCount(2)}");
-                    }
-                }
-            })
-            {
-                IsBackground = true
-            };
-
-            interactiveThread.Start();
-
-            started.WaitOne();
-        }
-
-        private static string GetAllocatedMemory(bool forceFullCollection = false)
-        {
-            double bytes = GC.GetTotalMemory(forceFullCollection);
-
-            return $"{((bytes / 1024d) / 1024d).ToString("N2")} MB";
-        }
-
         private static int GetThreadCount(IConfigurationRoot config)
         {
             var threadCountValue = config["threadCount"];
@@ -139,4 +73,3 @@ namespace Benchmarks
         }
     }
 }
-

+ 12 - 17
frameworks/CSharp/aspnetcore/Benchmarks/Startup.cs

@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Hosting;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
+using MySql.Data.MySqlClient;
 using Npgsql;
 
 namespace Benchmarks
@@ -50,24 +51,28 @@ namespace Benchmarks
 
             // Common DB services
             services.AddSingleton<IRandom, DefaultRandom>();
-            services.AddSingleton<ApplicationDbSeeder>();
             services.AddEntityFrameworkSqlServer();
 
             var appSettings = Configuration.Get<AppSettings>();
+            Console.WriteLine($"Database: {appSettings.Database}");
+
             if (appSettings.Database == DatabaseServer.PostgreSql)
             {
-                services.AddDbContextPool<ApplicationDbContext>(options => options.UseNpgsql(appSettings.ConnectionString));
+                if (Scenarios.Any("Ef"))
+                {
+                    // services.AddDbContextPool<ApplicationDbContext>(options => options.UseNpgsql(appSettings.ConnectionString));
+                }
+                
                 if (Scenarios.Any("Raw") || Scenarios.Any("Dapper"))
                 {
                     services.AddSingleton<DbProviderFactory>(NpgsqlFactory.Instance);
                 }
             }
-            else
+            else if (appSettings.Database == DatabaseServer.MySql)
             {
-                services.AddDbContextPool<ApplicationDbContext>(options => options.UseSqlServer(appSettings.ConnectionString));
                 if (Scenarios.Any("Raw") || Scenarios.Any("Dapper"))
                 {
-                    services.AddSingleton<DbProviderFactory>(SqlClientFactory.Instance);
+                    services.AddSingleton<DbProviderFactory>(MySqlClientFactory.Instance);
                 }
             }
 
@@ -116,7 +121,7 @@ namespace Benchmarks
             }
         }
 
-        public void Configure(IApplicationBuilder app, ApplicationDbSeeder dbSeeder)
+        public void Configure(IApplicationBuilder app)
         {
             if (Scenarios.Plaintext)
             {
@@ -192,14 +197,6 @@ namespace Benchmarks
                 app.UseFortunesEf();
             }
 
-            if (Scenarios.Any("Db"))
-            {
-                if (!dbSeeder.Seed())
-                {
-                    Environment.Exit(1);
-                }
-            }
-
             if (Scenarios.Any("Mvc"))
             {
                 app.UseMvc();
@@ -209,8 +206,6 @@ namespace Benchmarks
             {
                 app.UseStaticFiles();
             }
-
-            app.RunDebugInfoPage();
         }
     }
-}
+}

+ 4 - 0
frameworks/CSharp/aspnetcore/Benchmarks/appsettings.mysql.json

@@ -0,0 +1,4 @@
+{
+  "ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=1024;SslMode=None;ConnectionReset=false",
+  "Database": "mysql"
+}

+ 2 - 2
frameworks/CSharp/aspnetcore/Benchmarks/appsettings.postgresql.json

@@ -1,4 +1,4 @@
 {
-  "ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=1024;NoResetOnClose=true;Max Auto Prepare=3",
+  "ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=1024;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3",
   "Database": "postgresql"
-}
+}

+ 50 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/AsciiString.cs

@@ -0,0 +1,50 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Text;
+using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
+
+namespace PlatformBenchmarks
+{
+    public readonly struct AsciiString : IEquatable<AsciiString>
+    {
+        private readonly byte[] _data;
+
+        public AsciiString(string s) => _data = Encoding.ASCII.GetBytes(s);
+
+        public int Length => _data.Length;
+
+        public ReadOnlySpan<byte> AsSpan() => _data;
+
+        public static implicit operator ReadOnlySpan<byte>(AsciiString str) => str._data;
+        public static implicit operator byte[] (AsciiString str) => str._data;
+
+        public static implicit operator AsciiString(string str) => new AsciiString(str);
+
+        public override string ToString() => HttpUtilities.GetAsciiStringNonNullCharacters(_data);
+        public static explicit operator string(AsciiString str) => str.ToString();
+
+        public bool Equals(AsciiString other) => ReferenceEquals(_data, other._data) || SequenceEqual(_data, other._data);
+        private bool SequenceEqual(byte[] data1, byte[] data2) => new Span<byte>(data1).SequenceEqual(data2);
+
+        public static bool operator ==(AsciiString a, AsciiString b) => a.Equals(b);
+        public static bool operator !=(AsciiString a, AsciiString b) => !a.Equals(b);
+        public override bool Equals(object other) => (other is AsciiString) && Equals((AsciiString)other);
+
+        public override int GetHashCode()
+        {
+            // Copied from x64 version of string.GetLegacyNonRandomizedHashCode()
+            // https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/String.Comparison.cs
+            var data = _data;
+            int hash1 = 5381;
+            int hash2 = hash1;
+            foreach (int b in data)
+            {
+                hash1 = ((hash1 << 5) + hash1) ^ b;
+            }
+            return hash1 + (hash2 * 1566083941);
+        }
+
+    }
+}

+ 157 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.cs

@@ -0,0 +1,157 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Buffers;
+using System.IO.Pipelines;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
+using Utf8Json;
+
+namespace PlatformBenchmarks
+{
+    public class BenchmarkApplication : HttpConnection
+    {
+        private readonly static AsciiString _crlf = "\r\n";
+        private readonly static AsciiString _eoh = "\r\n\r\n"; // End Of Headers
+        private readonly static AsciiString _http11OK = "HTTP/1.1 200 OK\r\n";
+        private readonly static AsciiString _headerServer = "Server: Custom";
+        private readonly static AsciiString _headerContentLength = "Content-Length: ";
+        private readonly static AsciiString _headerContentLengthZero = "Content-Length: 0\r\n";
+        private readonly static AsciiString _headerContentTypeText = "Content-Type: text/plain\r\n";
+        private readonly static AsciiString _headerContentTypeJson = "Content-Type: application/json\r\n";
+
+
+        private readonly static AsciiString _plainTextBody = "Hello, World!";
+
+        private static class Paths
+        {
+            public readonly static AsciiString Plaintext = "/plaintext";
+            public readonly static AsciiString Json = "/json";
+        }
+
+        private bool _isPlainText;
+        private bool _isJson;
+
+        public override void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
+        {
+            if (path.StartsWith(Paths.Plaintext) && method == HttpMethod.Get)
+            {
+                _isPlainText = true;
+            }
+            else if (path.StartsWith(Paths.Json) && method == HttpMethod.Get)
+            {
+                _isJson = true;
+            }
+            else
+            {
+                _isPlainText = false;
+                _isJson = false;
+            }
+        }
+
+        public override void OnHeader(Span<byte> name, Span<byte> value)
+        {
+        }
+
+        public override ValueTask ProcessRequestAsync()
+        {
+            if (_isPlainText)
+            {
+                PlainText(Writer);
+            }
+            else if (_isJson)
+            {
+                Json(Writer);
+            }
+            else
+            {
+                Default(Writer);
+            }
+
+            return default;
+        }
+
+        public override async ValueTask OnReadCompletedAsync()
+        {
+            await Writer.FlushAsync();
+        }
+
+        private static void PlainText(PipeWriter pipeWriter)
+        {
+            var writer = new BufferWriter<PipeWriter>(pipeWriter);
+            // HTTP 1.1 OK
+            writer.Write(_http11OK);
+
+            // Server headers
+            writer.Write(_headerServer);
+
+            // Date header
+            writer.Write(DateHeader.HeaderBytes);
+
+            // Content-Type header
+            writer.Write(_headerContentTypeText);
+
+            // Content-Length header
+            writer.Write(_headerContentLength);
+            writer.WriteNumeric((ulong)_plainTextBody.Length);
+
+            // End of headers
+            writer.Write(_eoh);
+
+            // Body
+            writer.Write(_plainTextBody);
+            writer.Commit();
+        }
+
+        private static void Json(PipeWriter pipeWriter)
+        {
+            var writer = new BufferWriter<PipeWriter>(pipeWriter);
+
+            // HTTP 1.1 OK
+            writer.Write(_http11OK);
+
+            // Server headers
+            writer.Write(_headerServer);
+
+            // Date header
+            writer.Write(DateHeader.HeaderBytes);
+
+            // Content-Type header
+            writer.Write(_headerContentTypeJson);
+
+            // Content-Length header
+            writer.Write(_headerContentLength);
+            var jsonPayload = JsonSerializer.SerializeUnsafe(new { message = "Hello, World!" });
+            writer.WriteNumeric((ulong)jsonPayload.Count);
+
+            // End of headers
+            writer.Write(_eoh);
+
+            // Body
+            writer.Write(jsonPayload);
+            writer.Commit();
+        }
+
+        private static void Default(PipeWriter pipeWriter)
+        {
+            var writer = new BufferWriter<PipeWriter>(pipeWriter);
+
+            // HTTP 1.1 OK
+            writer.Write(_http11OK);
+
+            // Server headers
+            writer.Write(_headerServer);
+
+            // Date header
+            writer.Write(DateHeader.HeaderBytes);
+
+            // Content-Length 0
+            writer.Write(_headerContentLengthZero);
+
+            // End of headers
+            writer.Write(_crlf);
+            writer.Commit();
+        }
+    }
+}

+ 81 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs

@@ -0,0 +1,81 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Net;
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.Extensions.Configuration;
+
+namespace PlatformBenchmarks
+{
+    public static class BenchmarkConfigurationHelpers
+    {
+        public static IWebHostBuilder UseBenchmarksConfiguration(this IWebHostBuilder builder, IConfiguration configuration)
+        {
+            builder.UseConfiguration(configuration);
+
+            // Handle the transport type
+            var webHost = builder.GetSetting("KestrelTransport");
+
+            // Handle the thread count
+            var threadCountRaw = builder.GetSetting("threadCount");
+            int? theadCount = null;
+
+            if (!string.IsNullOrEmpty(threadCountRaw) && 
+                Int32.TryParse(threadCountRaw, out var value))
+            {
+                theadCount = value;
+            }
+
+            if (string.Equals(webHost, "Libuv", StringComparison.OrdinalIgnoreCase))
+            {
+                builder.UseLibuv(options =>
+                {
+                    if (theadCount.HasValue)
+                    {
+                        options.ThreadCount = theadCount.Value;
+                    }
+                });
+            }
+            else if (string.Equals(webHost, "Sockets", StringComparison.OrdinalIgnoreCase))
+            {
+                builder.UseSockets(options =>
+                {
+                    if (theadCount.HasValue)
+                    {
+                        options.IOQueueCount = theadCount.Value;
+                    }
+                });
+            }
+
+            return builder;
+        }
+        
+        public static IPEndPoint CreateIPEndPoint(this IConfiguration config)
+        {
+            var url = config["server.urls"] ?? config["urls"];
+
+            if (string.IsNullOrEmpty(url))
+            {
+                return new IPEndPoint(IPAddress.Loopback, 8080);
+            }
+
+            var address = ServerAddress.FromUrl(url);
+
+            IPAddress ip;
+
+            if (string.Equals(address.Host, "localhost", StringComparison.OrdinalIgnoreCase))
+            {
+                ip = IPAddress.Loopback;
+            }
+            else if (!IPAddress.TryParse(address.Host, out ip))
+            {
+                ip = IPAddress.IPv6Any;
+            }
+
+            return new IPEndPoint(ip, address.Port);
+        }
+    }
+}

+ 93 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BufferWriter.cs

@@ -0,0 +1,93 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.CompilerServices;
+
+namespace System.Buffers
+{
+    internal ref struct BufferWriter<T> where T: IBufferWriter<byte>
+    {
+        private T _output;
+        private Span<byte> _span;
+        private int _buffered;
+
+        public BufferWriter(T output)
+        {
+            _buffered = 0;
+            _output = output;
+            _span = output.GetSpan();
+        }
+
+        public Span<byte> Span => _span;
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public void Commit()
+        {
+            var buffered = _buffered;
+            if (buffered > 0)
+            {
+                _buffered = 0;
+                _output.Advance(buffered);
+            }
+        }
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public void Advance(int count)
+        {
+            _buffered += count;
+            _span = _span.Slice(count);
+        }
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public void Write(ReadOnlySpan<byte> source)
+        {
+            if (_span.Length >= source.Length)
+            {
+                source.CopyTo(_span);
+                Advance(source.Length);
+            }
+            else
+            {
+                WriteMultiBuffer(source);
+            }
+        }
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public void Ensure(int count = 1)
+        {
+            if (_span.Length < count)
+            {
+                EnsureMore(count);
+            }
+        }
+
+        [MethodImpl(MethodImplOptions.NoInlining)]
+        private void EnsureMore(int count = 0)
+        {
+            if (_buffered > 0)
+            {
+                Commit();
+            }
+
+            _output.GetMemory(count);
+            _span = _output.GetSpan();
+        }
+
+        private void WriteMultiBuffer(ReadOnlySpan<byte> source)
+        {
+            while (source.Length > 0)
+            {
+                if (_span.Length == 0)
+                {
+                    EnsureMore();
+                }
+
+                var writable = Math.Min(source.Length, _span.Length);
+                source.Slice(0, writable).CopyTo(_span);
+                source = source.Slice(writable);
+                Advance(writable);
+            }
+        }
+    }
+}

+ 38 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BufferWriterExtensions.cs

@@ -0,0 +1,38 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Buffers.Text;
+using System.Diagnostics;
+using System.IO.Pipelines;
+using System.Runtime.CompilerServices;
+
+namespace System.Buffers
+{
+    internal static class BufferWriterExtensions
+    {
+        private const int MaxULongByteLength = 20;
+
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        internal static void WriteNumeric(ref this BufferWriter<PipeWriter> buffer, ulong number)
+        {
+            // Try to format directly
+            if (Utf8Formatter.TryFormat(number, buffer.Span, out int bytesWritten))
+            {
+                buffer.Advance(bytesWritten);
+            }
+            else
+            {
+                // Ask for at least 20 bytes
+                buffer.Ensure(MaxULongByteLength);
+
+                Debug.Assert(buffer.Span.Length >= 20, "Buffer is < 20 bytes");
+
+                // Try again
+                if (Utf8Formatter.TryFormat(number, buffer.Span, out bytesWritten))
+                {
+                    buffer.Advance(bytesWritten);
+                }
+            }
+        }
+    }
+}

+ 59 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/DateHeader.cs

@@ -0,0 +1,59 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Buffers.Text;
+using System.Diagnostics;
+using System.Text;
+using System.Threading;
+using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
+
+namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
+{
+    /// <summary>
+    /// Manages the generation of the date header value.
+    /// </summary>
+    internal static class DateHeader 
+    {
+        const int prefixLength = 8; // "\r\nDate: ".Length
+        const int dateTimeRLength = 29; // Wed, 14 Mar 2018 14:20:00 GMT
+        const int suffixLength = 2; // crlf
+        const int suffixIndex = dateTimeRLength + prefixLength;
+
+        private static readonly Timer s_timer = new Timer((s) => {
+            SetDateValues(DateTimeOffset.UtcNow);
+        }, null, 1000, 1000);
+
+        private static byte[] s_headerBytesMaster = new byte[prefixLength + dateTimeRLength + suffixLength];
+        private static byte[] s_headerBytesScratch = new byte[prefixLength + dateTimeRLength + suffixLength];
+
+        static DateHeader()
+        {
+            var utf8 = Encoding.ASCII.GetBytes("\r\nDate: ").AsSpan();
+            utf8.CopyTo(s_headerBytesMaster);
+            utf8.CopyTo(s_headerBytesScratch);
+            s_headerBytesMaster[suffixIndex] = (byte)'\r';
+            s_headerBytesMaster[suffixIndex + 1] = (byte)'\n';
+            s_headerBytesScratch[suffixIndex] = (byte)'\r';
+            s_headerBytesScratch[suffixIndex + 1] = (byte)'\n';
+            SetDateValues(DateTimeOffset.UtcNow);
+        }
+
+        public static ReadOnlySpan<byte> HeaderBytes => s_headerBytesMaster;
+
+        private static void SetDateValues(DateTimeOffset value)
+        {
+            lock (s_headerBytesScratch)
+            {
+                if (!Utf8Formatter.TryFormat(value, s_headerBytesScratch.AsSpan().Slice(prefixLength), out int written, 'R'))
+                {
+                    throw new Exception("date time format failed");
+                }
+                Debug.Assert(written == dateTimeRLength);
+                var temp = s_headerBytesMaster;
+                s_headerBytesMaster = s_headerBytesScratch;
+                s_headerBytesScratch = temp;
+            }
+        }
+    }
+}

+ 161 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/HttpApplication.cs

@@ -0,0 +1,161 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Buffers;
+using System.IO.Pipelines;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Connections;
+using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
+
+namespace PlatformBenchmarks
+{
+    public static class HttpApplicationConnectionBuilderExtensions
+    {
+        public static IConnectionBuilder UseHttpApplication<TConnection>(this IConnectionBuilder builder) where TConnection : HttpConnection, new()
+        {
+            return builder.Use(next => new HttpApplication<TConnection>().ExecuteAsync);
+        }
+    }
+
+    public class HttpApplication<TConnection> where TConnection : HttpConnection, new()
+    {
+        public Task ExecuteAsync(ConnectionContext connection)
+        {
+            var parser = new HttpParser<HttpConnection>();
+
+            var httpConnection = new TConnection
+            {
+                Parser = parser,
+                Reader = connection.Transport.Input,
+                Writer = connection.Transport.Output
+            };
+            return httpConnection.ExecuteAsync();
+        }
+    }
+
+    public class HttpConnection : IHttpHeadersHandler, IHttpRequestLineHandler
+    {
+        private State _state;
+
+        public PipeReader Reader { get; set; }
+        public PipeWriter Writer { get; set; }
+
+        internal HttpParser<HttpConnection> Parser { get; set; }
+
+        public virtual void OnHeader(Span<byte> name, Span<byte> value)
+        {
+
+        }
+
+        public virtual void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
+        {
+
+        }
+
+        public virtual ValueTask ProcessRequestAsync()
+        {
+            return default;
+        }
+
+        public virtual ValueTask OnReadCompletedAsync()
+        {
+            return default;
+        }
+
+        public async Task ExecuteAsync()
+        {
+            try
+            {
+                await ProcessRequestsAsync();
+
+                Reader.Complete();
+            }
+            catch (Exception ex)
+            {
+                Reader.Complete(ex);
+            }
+            finally
+            {
+                Writer.Complete();
+            }
+        }
+
+        private async Task ProcessRequestsAsync()
+        {
+            while (true)
+            {
+                var task = Reader.ReadAsync();
+
+                if (!task.IsCompleted)
+                {
+                    // No more data in the input
+                    await OnReadCompletedAsync();
+                }
+
+                var result = await task;
+                var buffer = result.Buffer;
+                var consumed = buffer.Start;
+                var examined = buffer.End;
+
+                if (!buffer.IsEmpty)
+                {
+                    ParseHttpRequest(buffer, out consumed, out examined);
+
+                    if (_state != State.Body && result.IsCompleted)
+                    {
+                        ThrowUnexpectedEndOfData();
+                    }
+                }
+                else if (result.IsCompleted)
+                {
+                    break;
+                }
+
+                Reader.AdvanceTo(consumed, examined);
+
+                if (_state == State.Body)
+                {
+                    await ProcessRequestAsync();
+
+                    _state = State.StartLine;
+                }
+            }
+        }
+
+        private void ParseHttpRequest(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
+        {
+            consumed = buffer.Start;
+            examined = buffer.End;
+
+            var parsingStartLine = _state == State.StartLine;
+            if (parsingStartLine)
+            {
+                if (Parser.ParseRequestLine(this, buffer, out consumed, out examined))
+                {
+                    _state = State.Headers;
+                }
+            }
+
+            if (_state == State.Headers)
+            {
+                if (Parser.ParseHeaders(this, parsingStartLine ? buffer.Slice(consumed) : buffer, out consumed, out examined, out int consumedBytes))
+                {
+                    _state = State.Body;
+                }
+            }
+        }
+
+        private static void ThrowUnexpectedEndOfData()
+        {
+            throw new InvalidOperationException("Unexpected end of data!");
+        }
+
+        private enum State
+        {
+            StartLine,
+            Headers,
+            Body
+        }
+    }
+}

+ 7 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/NuGet.Config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <packageSources>
+    <clear />
+    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
+  </packageSources>
+</configuration>

+ 14 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/PlatformBenchmarks.csproj

@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp2.1</TargetFramework>
+    <OutputType>Exe</OutputType>
+    <LangVersion>latest</LangVersion>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  
+  <ItemGroup>
+    <PackageReference Include="Utf8Json" Version="1.3.7" />
+    <PackageReference Include="Microsoft.AspNetCore.All" />
+  </ItemGroup>
+</Project>

+ 46 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/Program.cs

@@ -0,0 +1,46 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Net;
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace PlatformBenchmarks
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+            BuildWebHost(args).Run();
+        }
+
+        public static IWebHost BuildWebHost(string[] args)
+        {
+            var config = new ConfigurationBuilder()
+                .AddEnvironmentVariables(prefix: "ASPNETCORE_")
+                .AddCommandLine(args)
+                .Build();
+
+            var host = new WebHostBuilder()
+                .UseBenchmarksConfiguration(config)
+                .UseKestrel((context, options) =>
+                {
+                    IPEndPoint endPoint = context.Configuration.CreateIPEndPoint();
+
+                    options.Listen(endPoint, builder =>
+                    {
+                        builder.UseHttpApplication<BenchmarkApplication>();
+                    });
+                })
+                .UseStartup<Startup>()
+                .Build();
+
+            return host;
+        }
+    }
+}

+ 19 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/Startup.cs

@@ -0,0 +1,19 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Net.WebSockets;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+
+namespace PlatformBenchmarks
+{
+    public class Startup
+    {
+        public void Configure(IApplicationBuilder app)
+        {
+            
+        }
+    }
+}

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mvc-ado-my.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryRaw,MvcDbMultiQueryRaw,MvcDbMultiUpdateRaw,MvcDbFortunesRaw"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mvc-ado-pg.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryRaw,MvcDbMultiQueryRaw,MvcDbMultiUpdateRaw,MvcDbFortunesRaw"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mvc-dap-my.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryDapper,MvcDbMultiQueryDapper,MvcDbMultiUpdateDapper,MvcDbFortunesDapper"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mvc-dap-pg.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryDapper,MvcDbMultiQueryDapper,MvcDbMultiUpdateDapper,MvcDbFortunesDapper"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mvc-ef-pg.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryEf,MvcDbMultiQueryEf,MvcDbMultiUpdateEf,MvcDbFortunesEf"]

+ 12 - 0
frameworks/CSharp/aspnetcore/aspcore-mvc.dockerfile

@@ -0,0 +1,12 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=mvcplaintext,mvcjson"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mw-ado-my.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryRaw,DbMultiQueryRaw,DbMultiUpdateRaw,DbFortunesRaw"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mw-ado-pg.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryRaw,DbMultiQueryRaw,DbMultiUpdateRaw,DbFortunesRaw"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mw-dap-my.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryDapper,DbMultiQueryDapper,DbMultiUpdateDapper,DbFortunesDapper"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mw-dap-pg.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryDapper,DbMultiQueryDapper,DbMultiUpdateDapper,DbFortunesDapper"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-mw-ef-pg.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryEf,DbMultiQueryEf,DbMultiUpdateEf,DbFortunesEf"]

+ 12 - 0
frameworks/CSharp/aspnetcore/aspcore-mw.dockerfile

@@ -0,0 +1,12 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY Benchmarks .
+RUN dotnet publish -c Release -o out
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=plaintext,json"]

+ 12 - 0
frameworks/CSharp/aspnetcore/aspcore.dockerfile

@@ -0,0 +1,12 @@
+FROM microsoft/dotnet:2.1-sdk-stretch AS build
+WORKDIR /app
+COPY PlatformBenchmarks .
+RUN dotnet publish -c Release -o out
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+
+ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll"]

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-middleware-dapper.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-dapper.sh setup-dapper.sh
-CMD bash setup-dapper.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-middleware-ef.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-ef.sh setup-ef.sh
-CMD bash setup-ef.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-middleware-json.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-json.sh setup-json.sh
-CMD bash setup-json.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-middleware-raw.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-raw.sh setup-raw.sh
-CMD bash setup-raw.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-mvc-dapper.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-mvc-dapper.sh setup-mvc-dapper.sh
-CMD bash setup-mvc-dapper.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-mvc-ef.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-mvc-ef.sh setup-mvc-ef.sh
-CMD bash setup-mvc-ef.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-mvc-json.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-mvc-json.sh setup-mvc-json.sh
-CMD bash setup-mvc-json.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-mvc-raw.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-mvc-raw.sh setup-mvc-raw.sh
-CMD bash setup-mvc-raw.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore-mvc.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-mvc-plaintext.sh setup-mvc-plaintext.sh
-CMD bash setup-mvc-plaintext.sh

+ 0 - 6
frameworks/CSharp/aspnetcore/aspnetcore.dockerfile

@@ -1,6 +0,0 @@
-FROM microsoft/dotnet:2.0-sdk-jessie
-WORKDIR /aspnetcore
-COPY Benchmarks Benchmarks
-COPY run-linux.sh run-linux.sh
-COPY setup-plaintext.sh setup-plaintext.sh
-CMD bash setup-plaintext.sh

+ 68 - 41
frameworks/CSharp/aspnetcore/benchmark_config.json

@@ -1,11 +1,12 @@
 {
-  "framework": "aspnetcore",
+  "framework": "aspcore",
   "tests": [{
     "default": {
       "plaintext_url": "/plaintext",
+      "json_url": "/json",
       "port": 8080,
       "approach": "Realistic",
-      "classification": "Micro",
+      "classification": "Platform",
       "database": "None",
       "framework": "ASP.NET Core",
       "language": "C#",
@@ -15,11 +16,12 @@
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-linux",
+      "display_name": "aspcore",
       "notes": "",
       "versus": ""
     },
-    "middleware-json": {
+    "mw": {
+      "plaintext_url": "/plaintext",
       "json_url": "/json",
       "port": 8080,
       "approach": "Realistic",
@@ -33,11 +35,11 @@
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-linux",
+      "display_name": "aspcore-mw",
       "notes": "",
       "versus": ""
     },
-    "middleware-raw": {
+    "mw-ado-pg": {
       "db_url": "/db/raw",
       "query_url": "/queries/raw?queries=",
       "update_url": "/updates/raw?queries=",
@@ -54,32 +56,53 @@
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-middleware-raw",
+      "display_name": "aspcore-mw-ado-pg",
       "notes": "",
       "versus": ""
     },
-    "middleware-ef": {
-      "db_url": "/db/ef",
-      "query_url": "/queries/ef?queries=",
-      "update_url": "/updates/ef?queries=",
-      "fortune_url": "/fortunes/ef",
+    "mw-dap-pg": {
+      "db_url": "/db/dapper",
+      "query_url": "/queries/dapper?queries=",
+      "update_url": "/updates/dapper?queries=",
+      "fortune_url": "/fortunes/dapper",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Micro",
       "database": "Postgres",
       "framework": "ASP.NET Core",
       "language": "C#",
-      "orm": "Full",
+      "orm": "Micro",
       "platform": ".NET",
       "flavor": "CoreCLR",
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-middleware-ef",
+      "display_name": "aspcore-mw-dap-pg",
       "notes": "",
       "versus": ""
     },
-    "middleware-dapper": {
+    "mw-ado-my": {
+      "db_url": "/db/raw",
+      "query_url": "/queries/raw?queries=",
+      "update_url": "/updates/raw?queries=",
+      "fortune_url": "/fortunes/raw",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "MySQL",
+      "framework": "ASP.NET Core",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": ".NET",
+      "flavor": "CoreCLR",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "aspcore-mw-ado-my",
+      "notes": "",
+      "versus": ""
+    },
+    "mw-dap-my": {
       "db_url": "/db/dapper",
       "query_url": "/queries/dapper?queries=",
       "update_url": "/updates/dapper?queries=",
@@ -87,7 +110,7 @@
       "port": 8080,
       "approach": "Realistic",
       "classification": "Micro",
-      "database": "Postgres",
+      "database": "MySQL",
       "framework": "ASP.NET Core",
       "language": "C#",
       "orm": "Micro",
@@ -96,12 +119,13 @@
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-middleware-dapper",
+      "display_name": "aspcore-mw-dap-my",
       "notes": "",
       "versus": ""
-    },
+    },    
     "mvc": {
       "plaintext_url": "/mvc/plaintext",
+      "json_url": "/mvc/json",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
@@ -114,16 +138,19 @@
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-mvc-linux",
+      "display_name": "aspcore-mvc",
       "notes": "",
       "versus": ""
     },
-    "mvc-json": {
-      "json_url": "/mvc/json",
+    "mvc-ado-pg": {
+      "db_url": "/mvc/db/raw",
+      "query_url": "/mvc/queries/raw?queries=",
+      "update_url": "/mvc/updates/raw?queries=",
+      "fortune_url": "/mvc/fortunes/raw",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
-      "database": "None",
+      "database": "Postgres",
       "framework": "ASP.NET Core",
       "language": "C#",
       "orm": "Raw",
@@ -132,53 +159,53 @@
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-mvc-linux",
+      "display_name": "aspcore-mvc-ado-pg",
       "notes": "",
       "versus": ""
     },
-    "mvc-raw": {
-      "db_url": "/mvc/db/raw",
-      "query_url": "/mvc/queries/raw?queries=",
-      "update_url": "/mvc/updates/raw?queries=",
-      "fortune_url": "/mvc/fortunes/raw",
+    "mvc-dap-pg": {
+      "db_url": "/mvc/db/dapper",
+      "query_url": "/mvc/queries/dapper?queries=",
+      "update_url": "/mvc/updates/dapper?queries=",
+      "fortune_url": "/mvc/fortunes/dapper",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
       "database": "Postgres",
       "framework": "ASP.NET Core",
       "language": "C#",
-      "orm": "Raw",
+      "orm": "Micro",
       "platform": ".NET",
       "flavor": "CoreCLR",
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-mvc-raw",
+      "display_name": "aspcore-mvc-dap-pg",
       "notes": "",
       "versus": ""
     },
-    "mvc-ef": {
-      "db_url": "/mvc/db/ef",
-      "query_url": "/mvc/queries/ef?queries=",
-      "update_url": "/mvc/updates/ef?queries=",
-      "fortune_url": "/mvc/fortunes/ef",
+    "mvc-ado-my": {
+      "db_url": "/mvc/db/raw",
+      "query_url": "/mvc/queries/raw?queries=",
+      "update_url": "/mvc/updates/raw?queries=",
+      "fortune_url": "/mvc/fortunes/raw",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
-      "database": "Postgres",
+      "database": "MySQL",
       "framework": "ASP.NET Core",
       "language": "C#",
-      "orm": "Full",
+      "orm": "Raw",
       "platform": ".NET",
       "flavor": "CoreCLR",
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-mvc-ef",
+      "display_name": "aspcore-mvc-ado-my",
       "notes": "",
       "versus": ""
     },
-    "mvc-dapper": {
+    "mvc-dap-my": {
       "db_url": "/mvc/db/dapper",
       "query_url": "/mvc/queries/dapper?queries=",
       "update_url": "/mvc/updates/dapper?queries=",
@@ -186,7 +213,7 @@
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
-      "database": "Postgres",
+      "database": "MySQL",
       "framework": "ASP.NET Core",
       "language": "C#",
       "orm": "Micro",
@@ -195,7 +222,7 @@
       "webserver": "Kestrel",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "aspnetcore-mvc-dapper",
+      "display_name": "aspcore-mvc-dap-my",
       "notes": "",
       "versus": ""
     }

+ 0 - 14
frameworks/CSharp/aspnetcore/run-linux.sh

@@ -1,14 +0,0 @@
-#!/bin/bash
-
-threadCount=$2
-if [ "$threadCount" -lt "1" ]
-then
-    threadCount=1
-fi
-
-cd Benchmarks
-cp appsettings.postgresql.json appsettings.json
-dotnet restore
-dotnet publish --configuration Release --output bin/Release/publish
-
-dotnet bin/Release/publish/Benchmarks.dll urls=http://*:8080 scenarios=$1 server=kestrel threadCount=$threadCount NonInteractive=true

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-dapper.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh 'DbSingleQueryDapper,DbMultiQueryDapper,DbMultiUpdateDapper,DbFortunesDapper' $(($(nproc)/2))

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-ef.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh 'DbSingleQueryEf,DbMultiQueryEf,DbMultiUpdateEf,DbFortunesEf' $(($(nproc)/2))

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-json.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh json $(nproc)

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-mvc-dapper.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh 'MvcDbSingleQueryDapper,MvcDbMultiQueryDapper,MvcDbMultiUpdateDapper,MvcDbFortunesDapper' $(($(nproc)/2))

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-mvc-ef.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh 'MvcDbSingleQueryEf,MvcDbMultiQueryEf,MvcDbMultiUpdateEf,MvcDbFortunesEf' $(($(nproc)/2))

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-mvc-json.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh mvcjson $(nproc)

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-mvc-plaintext.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh mvcplaintext 2

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-mvc-raw.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh 'MvcDbSingleQueryRaw,MvcDbMultiQueryRaw,MvcDbMultiUpdateRaw,MvcDbFortunesRaw' $(($(nproc)/2))

+ 0 - 24
frameworks/CSharp/aspnetcore/setup-plaintext.sh

@@ -1,24 +0,0 @@
-#!/bin/bash
-
-if [ "$(nproc)" -eq "80" ]
-then
-    threadCount=24
-fi
-
-if [ "$(nproc)" -eq "28" ]
-then
-    threadCount=8
-fi
-
-if [ "$(nproc)" -eq "4" ]
-then
-    threadCount=2
-fi
-
-if [ -z "$threadCount" ]
-then
-    echo "Invalid thread count ($(nproc)), using default"
-    threadCount=2
-fi
-
-source run-linux.sh plaintext $threadCount

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-raw.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh 'DbSingleQueryRaw,DbMultiQueryRaw,DbMultiUpdateRaw,DbFortunesRaw' $(($(nproc)/2))