net開源框架download.microsoft.com/download/7/8/d/78d289b4-cc... · 5/9/2016  · .net core •...

51
.NET開源框架 提升前後端開發生產力

Upload: others

Post on 27-May-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET開源框架提升前後端開發生產力

Page 2: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

. NET開源框架提升前後端開發生產力

徐玉濤 Tory Xu高級技術顧問

開發體驗與平臺合作事業部

微軟 Microsoft

周鋒 Feng Zhou產品總監

雷火遊戲事業部

網易 NetEase

Page 3: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Agenda

.NET的今天與明天

.NET快速概覽移植到.NET Core

.NET Core應用案例 –網易遊戲

Page 4: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET Framework .NET Core .NET implementation for any scenario on Windows

with comprehensive library support

.NET for modern app needs and development workflows.

Cross-platform and Open Source.

.NET

!=

Page 5: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Innovation Any app, any platform

Openness

.NET Core

ASP.NET Core

Page 6: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET展望

Page 7: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET FRAMEWORK .NET COREXAMARIN

Page 8: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET FRAMEWORK .NET CORE XAMARIN

AP

P

MO

DELS

BA

SE

LIB

RA

RIE

S

*

Page 9: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET FRAMEWORK .NET CORE XAMARIN

AP

P

MO

DELS

BA

SE

LIB

RA

RIE

S

Page 10: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 11: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET FRAMEWORK .NET CORE XAMARIN

*

Page 12: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET FRAMEWORK .NET CORE XAMARIN

Page 13: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 14: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET FRAMEWORK .NET CORE XAMARIN

*

TOOLS

Page 15: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Developed in the open

http://dotnet.github.io

Page 16: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Developed in the open

http://dotnet.github.io

Page 17: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 18: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Announcing

Page 19: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Next gen JIT (RyuJIT)

SIMD

Runtime Components Compilers

Languages innovation

.NET Compiler Platform

.NET Core 5 Libraries

.NET Framework 4.6 Libraries

NuGet packages

.NET未來藍圖

.NET Framework 4.6 .NET Core

Page 20: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Next gen JIT (RyuJIT)

SIMD

Runtime Components Compilers

Languages innovation

.NET Compiler Platform

.NET Core Libraries

.NET Framework 4.6 Libraries

NuGet packages

.NET Framework 4.6 .NET Core

.NET

Page 21: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Runtime & Languages

• 64-Bit JIT Compiler (a.k.a

RyuJIT)

• Performance

• New capabilities (SIMD)

• C# 6, VB 14• String interpolation, nameof, Null propagation

• [C#] Exception filters

• [VB] Multiline string literals

• F# 4.0• Slicing syntax for lists

• High-dimensional array support

Page 22: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Compiler Platform (a.k.a Roslyn)

• Enable better tooling

• Code analyzers• Plugins that provide live guidance within

Visual Studio

• NuGet or vsix

• Enforce best practices for a library, an org

or other domain

• Code aware libraries• = Library + Code Analyzer/Fix

• A library that provides guidance oncorrect use through embedded tooling and operates on the user's code in real time

Page 23: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Package Management

• NuGet• Package manager console

• .NET Framework & .NET Core libraries

• Indirect dependencies managed automatically

• ASP.NET and Visual Studio 2015

• Built in support for Bower & NPM

Page 24: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Next gen JIT (RyuJIT)

SIMD

Runtime Components Compilers

Languages innovation

.NET Compiler Platform

.NET Core Libraries

.NET Framework 4.6 Libraries

NuGet packages

.NET Framework 4.6 .NET Core

.NET

Page 25: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET Framework 4.6

.NET

Framework 4

.NET

Framework 4.5

4.5.1 4.5.2

4.6.1

.NET Framework 4.6

Page 26: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Next gen JIT (RyuJIT)

SIMD

Runtime Components Compilers

Languages innovation

.NET Compiler Platform

.NET Core Libraries

.NET Framework 4.6 Libraries

NuGet packages

.NET Framework 4.6 .NET Core

.NET

Page 27: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Windows Forms

• Here to stay…

• Great way to build desktop apps

• .NET Framework 4.6• RyuJIT

• HighDPI

• Roslyn

Page 28: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

WPF in .NET 4.6

• Performance

• DirectX Interoperability

• Modern Hardware• Touch & HighDPI

• Tooling• Blend for Visual Studio 2015

• Live Visual Tree

• UI Debugging tools for XAML

• Diagnostics timeline tool

Connect bugs >10 votes

reactivated for investigation

4/5 fixed of .NET 4.6

Page 29: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

XboxIoT

Page 30: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

• Next Generation Compiler in the Cloud for Store Apps

• Uses lean runtime and VC++ optimizer for fast code execution and reduced memory usage

.NET Native – native compilation for .NET

• Consistent toolkit across Windows device family

• New Windows 10 Controls

• Adaptive capabilities

Universal Windows Platform

Page 31: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET and Xamarin

• Share app logic across

platforms• Native apps for Windows, iOS and Android devices

using .NET

• Most productive and powerful platform for creating native applications

• Maximize code reuse with Universal Projects & Portable Class Libraries

• 100% APIs exposed• Everything you can do in xCode or ADT you can do

with Visual Studio

C# + XIB C# + AXML C# + XAML

Native UI Native UI Native UI

Xamarin .NET Core

Page 32: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

• ASP.NET Core builds on top of .NET Core

• Single framework, for web, services, and microservices

• Middle-ware pipeline, enabling you to inject as little or much functionality as needed

• Fully integrates with CLI tooling and the shared framework

• Takes advantage of .NET Core performance and include a very high performance web server, built on LibUV

Page 33: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Next gen JIT (RyuJIT)

SIMD

Runtime Components Compilers

Languages innovation

.NET Compiler Platform

.NET Core Libraries

.NET Framework 4.6 Libraries

NuGet packages

.NET Framework 4.6 .NET Core

.NET

Page 34: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

.NET Core

• Modular and smaller implementation of .NET

• Cross-platform

• App-level isolation

• Built in the open

• Optimized for specificworkloads

• Built for the next ten years of software development

ASP.NET Core

App Model

Universal Windows Apps Model

Any other

app model

Unified Base Class Library

Runtime Adaption Layer

.NET NativeCore CLR Other Runtime

Page 35: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 36: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

移植到 .NET Core

https://blogs.msdn.microsoft.com/dotnet/2016/02/10/port

ing-to-net-core/

Page 37: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 38: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

App Model ASP.NET Core UWP Console

移植動因

現有ASP.NET應用跨平臺MacOS開發,Linux部署新功能

跨Windows設備,如PC、平板、手機、物聯網、Xbox等

跨作業系統.NET Native

適合的應用場景 使用MVC和WebAPI的網站Win8.x/WP8.x應用WP Silverlight應用

大部分主控台應用都需要評估使用的dependencies,例如COM難移植

不適合的應用場景 使用了WebForms的網站Windows Forms桌面應用WPF桌面應用

Page 39: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 40: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

Unity3D cross-clients .NET Core cross-servers

Page 41: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 42: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

絕代雙驕中.Net Core的應用分享

Page 43: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

80+手游/端游自研

網易遊戲開發者專區AppStore為我們單獨提供

Page 44: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

古龍知名IP,擁有龐大粉絲受衆

影音品質,精雕細琢

原創美術風格:Q版人物和中式唯美場景

200頁手繪漫畫表現劇情

百餘位絕代雙驕劇情人物

俠客獨有武功,戰術千變萬化

填補行業空白 格戰玩法和手遊操作習慣的結合

即時多人戰鬥模式 人與人的較量

核心特點

Page 45: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

絕代雙驕和.NetCore

前端:Unity3D, C#后端:.Net Core,C#

Page 46: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

前後端開發語言一致性帶來的好處

好處: 通用模組和工具豐富 可複用性高,減少邏輯冗余 跨平臺,Windows開發,Linux部署

價值: 降低30%人員成本 加快20%的專案開發速度 説明碼農聚焦本質

享受Linux的成熟生態便利

Page 47: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

絕代雙驕後端框架-類web應用

NGINX REVERSE

PROXY

GM LOGIC LOGICSYN

CSYNC

Redis

MySQL

/HBase

BI

Backup

s

Cro

n

Redis

Client

Sqlite

log4n

et

RSysLog

Redi

sClie

nt

log4n

et

Sqlite

Antlr

3

Suppor

t

Page 48: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation

• Time taken for tests: 26.438373 sTotal calls: 30000Failed calls: 4Calls per second: 1134.714303 calls/s

• Percentage of time elapsed for 10000 calls of Reward/Get(ms)50% : 787.68897160% : 864.70317870% : 930.54795380% : 997.09200990% : 1062.75987695% : 1110.659838ALL : 1299.689054

• Percentage of time elapsed for 10000 calls of Game/End (ms)50% : 1050.10914860% : 1066.17307770% : 1087.54301180% : 1118.54314890% : 1165.43388495% : 1196.574926ALL : 1310.335875

簡要效能資料

典型遊戲伺服器性能要求:• 單台伺服器萬人同服,千人併發

• 回應延遲在1.5秒以下

.NET Core 的優勢:• 性能穩定,性能分化不明顯• 失敗率低• 充分利用CPU硬體優勢

Page 49: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation
Page 51: NET開源框架download.microsoft.com/download/7/8/D/78D289B4-CC... · 5/9/2016  · .NET Core • Modular and smaller implementation of .NET • Cross-platform • App-level isolation