当前位置:首页 > 报告详情

B会场-桂素伟-DotNET下AOT项目实战指南.pdf

上传人: 张** 编号:161030 2024-02-03 26页 9.69MB

1、?NETSTARS?.NET.NET?AOTAOT?AOTAOTAOTAOT?AOTAOT?AOTAOT?AOAOT TLinuxWindows95M87MB142ms809k97M83MB309ms746kPublished SizeWorking SetStarupRPSPublished SizeWorking SetStarupRPS.NET 8.NET 8 PerformancePerformance-Native AOTNative AOTLinuxWindows95M87MB142ms809k97M83MB309ms746kPublished SizeWorking SetSta

2、rupRPSPublished SizeWorking SetStarupRPS9.97M40M34ms724k8.87M55M74ms706k.NET 8.NET 8PerformancePerformance-Native AOTNative AOT?AOTAOT?FuncationFuncation as a Serviceas a Service?API?ID?AOTAOT?app.MapGet(/personpros,()=return typeof(Person).GetProperties().Select(s=s.Name).ToArray(););app.MapGet(/pe

3、rsonpros,()=return GetProperty(););string GetProperty()return typeof(T).GetProperties().Select(s=s.Name).ToArray();public class Personpublic string?Name get;set;public int Age get;set;public Sex Sex get;set;public override int GetHashCode()typeof(Person).GetMembers();return base.GetHashCode();dotnet

4、 tool install-global Swashbuckle.AspNetCore.CliJsonConverter(typeof(JsonStringEnumConverter)public enum Sex?,?,?)AOTAOT?Size?null?34674 KBTPS?1192.9 RT?3 P99?19?Speed?36918KBTPS?1163.9 RT?4 P99?20?Size?33881KBTPS?1189.2 RT?3 P99?19FROM scratch AS runtimeFROM alpine AS runtimeFROM AS buildWORKDIR/app

5、COPY aotdemo.csproj.RUN dotnet restore-runtime linux-x64 aotdemo.csprojRUN apt-get update&apt-get install-y-no-install-recommends clang zlib1g-devCOPY.RUN dotnet publish-c Release-r linux-x64-o out aotdemo.csprojWORKDIR/appCOPY-from=build/app/out/*/app/RUN rm-r/app/aotdemo.dbgRUN rm-r/app/appsetting

6、s.Development.jsonEXPOSE 8080ENTRYPOINT/app/aotdemoFROM scratch AS runtimeFROM alpine AS runtimeFROM AS buildWORKDIR/appCOPY aotdemo.csproj.RUN dotnet restore-runtime linux-x64 aotdemo.csprojRUN apt-get update&apt-get install-y-no-install-recommends clang zlib1g-devCOPY.RUN dotnet publish-c Release-

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
本文主要探讨了.NET应用程序的AOT(Ahead-Of-Time)编译,并对比了在Linux和Windows平台上的性能表现。文中提到了一个具体的.NET项目,通过Swashbuckle.AspNetCore生成OpenAPI文档,并使用Docker进行部署。项目使用了不同的Docker镜像,包括Debian、Alpine和Scratch,以测试在不同环境下的性能。文中给出了性能测试的数据,包括TPS(每秒事务数)、RT(响应时间)和P99(99%的请求响应时间)。结果显示,在AOT编译下,.NET应用程序在Linux和Windows平台上的性能都有所提升。
"Docker AOT 性能优化探究" Linux vs Windows" "Swagger 与 .NET 8 集成之道"
客服
商务合作
小程序
服务号
折叠