O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Whats New in ASP.NET Core

390 visualizações

Publicada em

Links: https://gist.github.com/jongalloway/387c5708f52ea2d7da6d5594b4399d53

Publicada em: Tecnologia
  • Login to see the comments

  • Seja a primeira pessoa a gostar disto

Whats New in ASP.NET Core

  1. 1. Build Performance Global Tools Span<T>, Memory<T> and friends
  2. 2. var arr = new byte[10]; Span<byte> bytes = arr; // Implicit cast from T[] to Span<T> Span<byte> slicedBytes = bytes.Slice(start: 5, length: 2); slicedBytes[0] = 42; slicedBytes[1] = 43; Assert.Equal(42, slicedBytes[0]); Assert.Equal(43, slicedBytes[1]); Assert.Equal(arr[5], slicedBytes[0]); Assert.Equal(arr[6], slicedBytes[1]); slicedBytes[2] = 44; // Throws IndexOutOfRangeException bytes[2] = 45; // OK Assert.Equal(arr[2], bytes[2]); Assert.Equal(45, arr[2]);
  3. 3. [coreclr example
  4. 4. https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/
  5. 5. private static readonly StringBuilder s_builder = new StringBuilder(); public void StringBuilderAppend() { StringBuilder sb = s_builder; sb.Length = 0; for (int i = 0; i < 100_000; i++) sb.Append(i); } Toolchain Mean Allocated .NET Core 2.0 6.523 ms 3992000 B .NET Core 2.1 3.268 ms 0 B
  6. 6. public string StringToLowerChangesNeeded() => "This is a test to see what happens when we call ToLower.".ToLower(); public string StringToLowerAlreadyCased() => "this is a test to see what happens when we call tolower.".ToLower(); Method Toolchain Mean Allocated StringToLowerChangesNeeded .NET Core 2.0 187.00 ns 144 B StringToLowerChangesNeeded .NET Core 2.1 96.29 ns 144 B StringToLowerAlreadyCased .NET Core 2.0 197.21 ns 144 B StringToLowerAlreadyCased .NET Core 2.1 68.81 ns 0 B
  7. 7. “Using the same-size server, we were able to go from 1,000 requests per second per node with Node.js to 20,000 requests per second with .NET Core.“ — Raygun https://www.microsoft.com/net/customers Data sourced from official tests available at TechEmpower Round 16. Java Servlet .NET Core Node.js 6.97M requests / sec2.55M requests / sec 0.82M requests / sec
  8. 8. 2.6MM 599K 97K 2.9MM 662K 216K - 500,000 1,000,000 1,500,000 2,000,000 2,500,000 3,000,000 1 2 3 RUNTIME PERFORMANCE Series1 Series2 Data sourced from tests in our labs on same hardware as TechEmpower
  9. 9. SignalR Razor class libraries Identity UI library & scaffolding HTTPS GDPR MVC functional testing [ApiController], ActionResult<T> IHttpClientFactory Kestrel on Sockets Generic host builder Performance Updated SPA templates
  10. 10. • Add real-time web functionalities easily with Azure and .NET Core 2.1 • Enable via “services.AddSignalR().AddAzureSignalR()” Fully managed service No more worries about capacity provisioning, scaling, or persistent connections Use ASP.NET Core SignalR to build real-time experiences such as chat, stock tickers, live dashboards, and instant broadcasting </> Native SignalR development
  11. 11. .NET
  12. 12. ASP.NET Core 2.2 Preview 2
  13. 13. https://www.microsoft.com/net/download/dotnet-core/2.2 https://visualstudio.com/preview/
  14. 14. APIs are everywhere!
  15. 15. https://github.com/aspnet/SignalR-samples/tree/master/AndroidJavaClient
  16. 16. Install the .NET Core 2.2 Preview 2 SDK https://www.microsoft.com/net/download/dotnet-core/2.2
  17. 17. .NET
  18. 18. .cs .cshtml BROWSER WebAssembly (mono.wasm) .NET (mscorlib.dll, System.Core.dll,…) App.dll Compile to .NET assemblies
  19. 19. Try it out! https://blazor.net
  20. 20. What's New in ASP.NET Core? - .NET Conf 2018 All presentation links (Scan QR Code

×