View console
dotnet build /clp:PerformanceSummary
Project Evaluation Performance Summary:
377 ms /Users/dfowler/dev/consoleapp/consoleapp.csproj 3 calls
Project Performance Summary:
547 ms /Users/dfowler/dev/consoleapp/consoleapp.csproj 9 calls
426 ms Restore 1 calls
View gist:e7937e40471e641a3901542b1cfa1cb9
## Pipelined
Response headers
RequestsPerSecond: 3274743.68
Response and Request Headers (strings allocated for values)
RequestsPerSecond: 2809557.04
View ipv4only.cs
public static class WebHostBuilderIISExtensions
{
private static readonly string ServerPort = "PORT";
public static IWebHostBuilder UseIISIntegrationOnIpv4Only(this IWebHostBuilder webHostBuilder)
{
var port = webHostBuilder.GetSetting(ServerPort) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{ServerPort}");
var address = "http://127.0.0.1:" + port;
return webHostBuilder.UseIISIntegration()
View websockets.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
namespace SimpleWebSockets
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
View conferenceplannerswagger.json
{"swagger":"2.0","info":{"version":"v1","title":"Conference Planner API"},"basePath":"/","paths":{"/api/Attendees/{username}":{"get":{"tags":["Attendees"],"operationId":"ApiAttendeesByUsernameGet","consumes":[],"produces":[],"parameters":[{"name":"username","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Success"}}}},"/api/Attendees":{"post":{"tags":["Attendees"],"operationId":"ApiAttendeesPost","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":[],"parameters":[{"name":"input","in":"body","required":false,"schema":{"$ref":"#/definitions/Attendee"}}],"responses":{"200":{"description":"Success"}}}},"/api/Attendees/{username}/session/{sessionId}":{"post":{"tags":["Attendees"],"operationId":"ApiAttendeesByUsernameSessionBySessionIdPost","consumes":[],"produces":[],"parameters":[{"name":"username","in":"path","required":true,"type":"string"},{"name":"sessionId","in":"path","required":true,"type":"integer","format":"int32"}],"r
View AutoLoad.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyModel;
using WebApplication40;
View Dapper2.cs
// Whatever shared state you need, the root of the universe
public class DapperContext
{
private QueryCache _cache = new QueryCache();
public static DapperContext Instance = new DapperContext();
public Task<IEnumerable<dynamic>> QueryAsync(IDbConnection cnn, string sql, object param = null, IDbTransaction transaction = null, int? commandTimeout = null, CommandType? commandType = null)
{
// Real logic happens here
View AppController.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
namespace WebApplication30
{
public class AppController : Controller
{
public virtual void ConfigureServices(IServiceCollection services)
View HostedService.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
namespace WebApplication24
{
public abstract class HostedService : IHostedService
View pipes.cs
using System;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines;
namespace WebApplication19
{
public class Program
{
public static async Task Main(string[] args)