2

NET 8 预览版 2 亮点是Blazor - 张善友

 1 year ago
source link: https://www.cnblogs.com/shanyou/p/17220483.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

NET 8 预览版 2 亮点是Blazor

.NET 团队在2023年3月14日发布了.NET 8预览版2,博客文章地址:https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-2/, 亮点是了对Blazor的一些改进。

Blazor 方面获得了一个高性能网格组件QuickGrid ,用于以表格形式显示数据。ASP.NET 的首席项目经理Daniel Roth 在文章中说 它“旨在成为一种简单方便的数据显示数据的方式,同时仍然提供强大的功能,如排序,过滤,分页和虚拟化。

quickgrid.png

同时发布了一个演示网站:https://aspnet.github.io/quickgridsamples/, 其目的不是替换高级数据网格组件,例如来自商业组件供应商的组件,而是:

  • 为具有最常见需求的 Blazor 开发人员提供方便、简单且灵活的数据网格组件
  • 为生成 Blazor 数据网格组件的任何人提供参考体系结构和性能基线。随意在此基础上构建,或者只是从中复制代码。

另一项改进是使用 jiterpreter 提升了 BlazorWeb WebAssembly(客户端 Blazor)性能。这里介绍一下Jiterpreter : jiterpreter 是一项新的 .NET 8 运行时功能,可在 .NET IL 解释器中启用部分实时 (JIT) 编译支持,以实现改进的运行时性能。

文章里是这么介绍的(https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-2/#improved-blazor-webassembly-performance-with-the-jiterpreter):

Blazor WebAssembly 应用能够在浏览器中运行 .NET 代码,这要归功于在 WebAssembly 中实现的小型 .NET 运行时,该运行时随应用一起下载。此运行时是一个 .NET IL 解释器,功能齐全,大小相当小,允许开发人员快速迭代,但缺乏通过实时 (JIT) 编译执行本机代码的运行时性能优势。JITing 到 WebAssembly 需要动态创建新的 WebAssembly 模块并实例化它们,这给运行时带来了独特的挑战。Blazor WebAssembly 应用可以选择提前编译 (AOT) 到 WebAssembly,以提高运行时性能,但代价是下载大小要大得多。由于一些常见的 .NET 编码模式与 AOT 不兼容,因此仍然需要 .NET IL 解释器作为回退机制来维护完整功能。

在 .NET 8 预览版 2 中,会自动为 Blazor WebAssembly 应用启用 jiterpreter。您无需执行任何额外的操作即可将其打开。

jiterpreter-perf-low-level-ops.svg
jiterpreter-perf-json-serialization.svg

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK