Date post: | 12-Jan-2016 |
Category: |
Documents |
Upload: | cameron-denis-white |
View: | 224 times |
Download: | 0 times |
Habib Heydarian ([email protected])Program Manager, .NET3-589 The Next Generation of .NET for Building Applications
The Next Generation of .NET for Building Applications
3-589
Innovation in .NET: //BUILD 2014
Core .NET
Next gen JIT (“RyuJIT”)
SIMD
Runtime Compilers .NET Compiler Platform (“Roslyn”)
Languages innovation
Windows Desktop
Azure and Windows Server
Universal Windows apps
.NET NativeASP.NET updates
Windows Convergence
Native compilation
Cross-devices
Xamarin partnership
Web apps
.NET support for Azure Mobile Services
Cloud Services
Openness
Windows Store iOS and Android
.NET in devices and services
.NET 4.5.1 is now installed on 500+ million PCs!
First, a look at .NET 4.5.1
• 64-bit edit and continue
• Method return value inspection
• Async debugging enhancements
• Windows Store development improvements
• EF/ADO.NET connection resiliency
Developer productivity
Application performance
Continuous innovation
• ASP.NET application suspension
• Multi-core JIT improvements
• On-demand large-object heap compaction
• Consistent performance before and after servicing the .NET Framework
• .NET Framework updates
• NuGet releases
• Curated .NET Framework NuGet packages.NET 4.5.1
delivers many new innovations while maintaining a high compatibility bar.
The next generation of .NETInnovation X-Plat Openness
• .NET Native•Next Generation JIT• SIMD Support
•Cross-Platform Libs•Xamarin Partnership
• .NET Foundation
• Open Ecosystem
Announcing: .NET Native
Scenario Improvement (%)
Cold Startup 39.32%
Warm Startup 31.21%
Memory Usage
12.68%
Wordament on .NET Native:
Next Generation Compiler in the Cloud for Store Apps
Provides converged developer experience for .NET across devices
Uses lean runtime and VC++ optimizer for fast code execution and reduced memory usage
Developer Preview available today
.NET NativeNative runtime and compiler for .NETRuntimeLean and refactored .NET libraries and runtime
Compiler Powered by the same optimizing compiler backend as Visual C++
8 key benefitsProductivity of C#
Performance of C++
Convergence enables consistent .NET experience across all devices1st class developer experience in Visual Studio (edit/compile/debug)
Simple packaging, deployment and servicing (self-contained package)
Integrated with Store to enable Cloud Compilation
Native code generated in Cloud to optimize for device arch/OS/form factorFaster app startup time
Reduced app memory usage
Faster code execution due to advanced optimizations (using VC++ optimizer)
Available for x64, ARM (x86 is coming)
V1 is targeted at Store apps
.NET Native apps already in the Store
Visual Studio Experience for .NET Native 1. Enable 2. Debug/test app
.NET Native Demo
NBODY simulation with C#
Demo: Auto Vectorization
1. Scalar
2. Vectorized (on one core)
3. Vectorized and auto-parallelized
public void NbodyCPUKernel_Vect(Particle[] A, ref Particle B, long numBodies) { Float_4 acc; acc.x = 0; acc.y = 0; acc.z = 0; acc.w = 0;
// This loop is hot for (long j = 0; j < numBodies; j++) { Float_4 r; r.x = A[j].pos.x - B.pos.x; r.y = A[j].pos.y - B.pos.y; r.z = A[j].pos.z - B.pos.z; float distSqr = r.x * r.x + r.y * r.y + r.z * r.z; distSqr += softeningSquared; float invDist = 1.0f / (float)Math1.Sqrt(distSqr); float invDistCube = invDist * invDist * invDist; float s = fParticleMass * invDistCube; acc.x += r.x * s; acc.y += r.y * s; acc.z += r.z * s; } B.vel.x += acc.x * deltaTime; B.vel.y += acc.y * deltaTime; B.vel.z += acc.z * deltaTime; B.vel.x *= dampening; B.vel.y *= dampening; B.vel.z *= dampening; B.pos.x += B.vel.x * deltaTime; B.pos.y += B.vel.y * deltaTime; B.pos.z += B.vel.z * deltaTime;}
for (long j = 0; j < numBodies; j++){ Float_4 r;
r.x = A[j].pos.x - B.pos.x; r.y = A[j].pos.y - B.pos.y; r.z = A[j].pos.z - B.pos.z;
float distSqr = r.x * r.x + r.y * r.y + r.z * r.z; distSqr += softeningSquared;
float invDist = 1.0f / (float)Math1.Sqrt(distSqr); float invDistCube = invDist * invDist * invDist;
float s = fParticleMass * invDistCube;
acc.x += r.x * s; acc.y += r.y * s; acc.z += r.z * s;}
for loop automatically vectorized & parallelized
.NET Native: Call to actionLearn more about .NET Native
Download the .NET Native VS add-In
Try out your Store app with .NET Native
http://msdn.com/dotnetnative.NET Native FAQ.NET Native Deep Dive talk
Requires Visual Studio 2013 Update 2 RC
Visit us at the .NET booth for Q&A
Help us make .NET Native better.NET Native [email protected]
.NET code generation: A primer
Source code(C#/VB/F#)
MSIL bytecode Machine code
C#/VB/F# compiler
Code generation
Next generation JIT codenamed “RyuJIT” (1/2)Brand new just-in-time (JIT) compiler for .NET
Significant application startup improvement
Next Generation JIT Demo
Offer developers a high quality, scalable JIT compiler that delivers good throughput, code quality with consistent, predictable performance across all architectures.
Next generation JIT codenamed “RyuJIT” (2/2)
Innovation platform for advanced optimizations, e.g.• SIMD• Loop invariant code motion• Floating point performance
Available for x64 now (additional architectures coming)
Throughput —how fast the compiler generates code.Code quality—how fast the generated code executes.Consistency—how the generated code differs across architectures.Predictability—how throughput & CQ vary with different inputs to the compiler.
Next generation JIT: Call to actionLearn more about RyuJIT
Download RyuJIT Help us make RyuJIT better
RyuJIT CTP1: The next-generation JIT compiler for .NET
RyuJIT CTP2: Getting Ready for Prime-time
http://aka.ms/RyuJIT RyuJIT feedback ([email protected])
.NET compilation: A RoadmapDynamic Native
Optimizing JIT
Codename “RyuJIT”:Next Gen JIT
NGEN: On Device
MDIL-NGEN (Hybrid): In Cloud + On Device
.NET Native: In Cloud (optimized for static
compilation)
SIMD: Single Instruction, Multiple Data Top .NET requested
feature on UserVoice Enables data parallelism
in .NET Performance boost for
Games, Numerical Computing, Image Processing applications
Exposed as a .NET library available on NuGet
Available with RyuJIT CTP3
SIMD Each compute node
performs the same task on multiple “streams” of data
Designed to enable auto-scaling
CPU agnostic design by using length-variable generic vector types: SimdVector<T>
*
* Copyright Ars Technica
SIMD Demo
Relative performance gains with SIMD
Duration (s)0
1
2
3
4
5
6
7
8
Mandelbrot Render Time (lower is better)
Scalar SIMD (SSE2) SIMD (AVX)
SIMD: Single instruction, multiple dataSupport SSE2, AVX and other vector instructions in .NET.
For AVX, an app can scale up 8X on a processor supporting AVX.
For SSE2, an app can scale up 4X on a processor supporting SSE.
Developer preview available as part of RyuJIT CTP3.
How SIMD is exposedMicrosoft.Bcl.Simd NuGet package
public struct Vector<T> where T : struct{ public Vector(T value); public Vector(T[] values); public Vector(T[] values, int index); public static int Length { get; } public T this[int index] { get; } // With SIMD, these element wise operations are done in parallel: public static Vector<T> operator +(Vector<T> left, Vector<T> right); public static Vector<T> operator *(Vector<T> left, Vector<T> right); // ...}
Length is fixed, but hardware dependent
float[] values = GetValues();float increment = GetIncrement();float[] result = new float[values.Length] // Perform addition as manual loop:for (int i = 0; i < values.Length; i++) { values[i] += increment;}
Vector<float> values = GetValues();Vector<float> increment = GetIncrement(); // Perform addition as vector operation:Vector<float> result = values + increment;
SIMD usage in codeUnvectorized codeadds one valueat a time.
Using Vector<T>you can add multiple values simultaneously.
First SIMD CTP available today! Part of the RyuJIT CPT 3 released today New NuGet package that includes the vector APIs
Currently, the CTP only inludes support for SSE Support for AVX coming
For more details, see .NET blog http://blogs.msdn.com/b/dotnet/
SIMD Roadmap
.NET APIs: Productive, portable and feedback-drivenProductive and consistent
Portable and cross-platform
Feedback-driven
• One set of .NET APIs and concepts to learn• You can re-use your code across devices• You’ll find the APIs you expect on all platforms (ex: file, collections, reflection)
• Our NuGet packages support multiple platforms• Unified class library experience (‘One Class Library’) • Universal projects
• Shipping much more often• Make changes due to UserVoice and bug reports • Using light-weight public previews to collect feedback
Portable Class LibrariesPCL now in Visual Studio 2013 Express for Windows (free)
One class library Unification of PCL and Store apps Class Library• Select one or multiple
targets
Planning to extend to additional platforms
Access to native APIs (only 8.1 apps)• WinRT and XAML support• Converged WinRT as well
as .NET APIs
Windows Phone 8.1 support
Focus on growing PCL surface area
One Class Library
.NET open ecosystemCommunication Source code Cross-platform
• MVPs and “insiders” give us feedback on pre-release plans• Actively engaged with customers (individuals and business)• Active blog and social
• ASP.NET NuGet libs are OSS• .NET reference source
• Cross-platform licensing for PCL libraries• Partnership with Xamarin to extend platform consistency and portability
NuGet is a .NET delivery vehicleOwner Packages Downloads
netframework 21 4M
aspnet 682 35M
other_msft 223 19M
Microsoft 926 58M
A great way to add core functionality to your app
We maintain a curated list of supported packages
Top 10 NuGet packages (last 6 weeks)Position
Package Downloads
1 EntityFramework 508,172
2 jQuery 444,889
3 Newtonsoft.Json 442,818
4 Microsoft.AspNet.WebPages 375,678
5 Microsoft.AspNet.Mvc 347,764
6 Microsoft.AspNet.Razor 291,487
7 Microsoft.Net.Http 245,204
8 Microsoft.AspNet.WebApi.Client 237,426
9 Microsoft.AspNet.WebApi.Core 225,804
10 Microsoft.AspNet.WebApi.WebHost 223,068
Openness
Community
Rapid innovation
The .NET Foundation
.NET API for Hadoop WebClient
.NET Compiler Platform ("Roslyn").NET Map Reduce API for Hadoop
.NET Micro Framework
ASP.NET MVCASP.NET Web API
ASP.NET Web Pages
ASP.NET SignalR
Composition (MEF2)
Entity Framework
Linq to Hive
MEF (Managed Extensibility Framework)
OWIN Authentication Middleware
Rx (Reactive Extensions)
Web Protection Library
Windows Azure .NET SDK
Windows Phone Toolkit
WnsRecipe
Mimekit Xamarin.Auth
Xamarin.Mobile
Couchbase for .NET
Miguel de Icaza (Xamarin)
Laurent Bugnion (IdentityMine)
Niels Hartvig (Umbraco)
Anthony van der Hoorn (Glimpse)Paul Betts (GitHub)
Nigel Sampson (Compiled Experience)Join the conversation with the
community http://www.dotnetfoundation.org
Mailkit
System.Drawing
Source Code as Documentation
.NET next generation roadmap
.NET Native• ARM & X64
available today (Developer Preview)
• X86 coming• Auto-
vectorization coming
• Exploring additional scenarios based on customer feedback
Next gen. JIT• X64 available
today (DP)• Support for
additional architectures coming
SIMD• Support for
SSE2 available today (DP)
• AVX support coming
Cross-platform• Partnership
with Xamarin
• X-plat portable class libraries
.NET ecosystem• .NET
Foundation• One Class
Library• NuGet as the
delivery mechanism
Call To Action: Please try out the Developer Preview and give us feedback.
Stay tuned, there is more to come
We would love to hear from you!
@dotnet
dotnetBlog E-mail
UserVoiceMSDN Forums
Resources .NET sessions @ //BUILD
What's New for ASP.NET and Web in Visual Studio 2013 Update 2 and BeyondScott Hanselman, Scott Hunter
The Future of C#(“Roslyn”) Mads Torgersen, Dustin Campbell
Go Mobile with C# and Xamarin
Miguel de Icaza
Strategies for Developing Cross-Device Applications with Visual Studio 2013
David Carmona
The Present and Future of .NET in a World of Devices and Services
Jay Schmelzer
Technology Info Download
JIT “RyuJIT” http://aka.ms/RyuJITinfo http://aka.ms/RyuJIT
SIMD http://aka.ms/SIMDInfo http://aka.ms/SIMD
.NET Compiler Platform (“Roslyn”)
http://aka.ms/NETCompilerPlatform http://roslyn.codeplex.com
http://aka.ms/NetCompilerPlatformDownload
.NET support on Azure Mobile Services
http://aka.ms/azuremobileservicesnet
http://aka.ms/VS2013Update2
ASP.NET Updates in VS 2014 Update 2
http://aka.ms/VS2013Update2Info
http://aka.ms/VS2013Update2
Universal Windows apps
http://aka.ms/universalprojects
http://aka.ms/VS2013Update2
.NET Native http://aka.ms/dotnetnative
http://aka.ms/dotnetnativedownload
Xamarin http://xamarin.com http://xamarin.com
.NET Foundation http://www.dotnetfoundation.org
na
The Next Generation of .NET for Building Device Applications
Habib Heydarian
Your Feedback is Important
Fill out an evaluation of this session and help shape future events.
Scan the QR code to evaluate this session on your mobile device.
You’ll also be entered into a daily prize drawing!
© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.