在 4 月 2 日, 发布了. NET 5.0 Preview2, 这次发布对一些功能和性能做了相关的改进, 同时后面也会实施 5.0 版本更多的功能, 其中一些功能目前也 https://github.com/dotnet/designs/pulls 在. NET 5 Preview1 中可以看到. NET 5 里程碑中已经完成的建设任务, 当然可以查看相关的设计资料进行反馈, 同时可以下载 Preview2 并进行测试他.
可以在 Windows MacOS 和 Linux 下载. NET 5 Preview2
- .NET 5 Preview2 And Runtimes
- Docker Images https://hub.docker.com/_/microsoft-dotnet-core
- Snap Installer https://snapcraft.io/dotnet-sdk
ASP.NET Core 和 EF Core 也在当天发布.
必须要使用 Visual Studio 2019 16.6 才可以使用. NET 5.0. 安装最新版本的 C# 扩展, 将. NET 5.0 在 VisualStudio Code 中使用, 目前还不支持 Mac 的 Visual Studio.
发行说明:
.NET 5.0 Preview2 发行说明
.NET 5.0 已知问题
GitHub 中 issues https://github.com/dotnet/core/issues/4500
RyuJIT 中代码质量的改进
每个版本都包含着一些更改, 这些更改可以改进 JIT 生成的机器代码(它被称为 "code quality"). 更好的代码质量意味着更好的性能. 总而言之, 下面改进中一半的是实际的新优化, 另一半是由于更改 RyuJIT 的流程而使现有优化能够应用到更多的代码中.
- Use xmm for stack prolog - dotnet/runtime #32538 https://github.com/dotnet/runtime/pull/32538 更改为 x86/x64 prolog 归零代码, 改进: JSON;
- Add ValueNumbering support for GT_SIMD and GT_HWINTRINSIC tree nodes - dotnet/runtime #31834 https://github.com/dotnet/runtime/pull/31834 - 为 SIMD 和硬件固有类型启用优化器.
- Use GT_NULLCHECK for unconsumed indirections - dotnet/runtime #32641 https://github.com/dotnet/runtime/pull/32641 - 删除冗余 null 检查.
- invoke nullable box optimizations earlier - dotnet/runtime #32269 https://github.com/dotnet/runtime/pull/32269 - 改善优化 Nullable.
- Optimize range checks for various array index patterns - dotnet/runtime #1644 https://github.com/dotnet/runtime/pull/1644 - 消除 range checks 的改进.
- Optimize obj.GetType() != typeof(X) for sealed classes - dotnet/runtime #32790 https://github.com/dotnet/runtime/pull/32790 - 改进了类型检查表达式.
- Eliminate duplicate zero initializations more aggressively - dotnet/runtime #31960 https://github.com/dotnet/runtime/pull/31960 - 更好和更广泛的方法, 以消除重复零初始化.
- Fix method and basic block flags used by early opts - dotnet/runtime #2196 https://github.com/dotnet/runtime/pull/2126
优化某些可以频繁使用, 现在更经常地用常数替换数组长度.
垃圾收集器
- Card mark stealing - dotnet/coreclr #25986 https://github.com/dotnet/coreclr/pull/25986 - 服务器 GC(位于不同线程上)可以在标记由较早一代对象保留的 gen0/ 1 对象时进行执行获取. 这意味着, 对于某些 GC 线程要花费更长的时间进行标记的情况, 短暂的 GC 暂停时间较短.
- Introducing Pinned Object Heap - dotnet/runtime #32283 https://github.com/dotnet/runtime/pull/32283 - 实现了 POH(Pinned Object Heap)功能的一部分 - GC 内部的一部分. 这个新的堆 (本质上是 LOH 的对等体) 将允许 GC 分别管理固定对象, 从而避免固定对象对世代堆的负面影响.
- Allow allocating large object from free list while background sweeping SOH - dotnet/runtime #2103 https://github.com/dotnet/runtime/pull/2103 - 当 BGC 清理 SOH 时, 使用空闲列表启用 LOH 分配. 以前这只是在 LOH 上使用段空间的末端. 这样可以更好地使用堆.
- Background GC suspension fixes - dotnet/coreclr #27729 https://github.com/dotnet/coreclr/pull/27729 - 暂停修复程序减少了 BGC 和用户线程被暂停的时间. 这样可以减少发生 GC 之前挂起托管线程所需的总时间. dotnet / coreclr#27578 也有助于达到相同的结果.
- Fix named cgroup handling in docker - dotnet/runtime #980 https://github.com/dotnet/runtime/pull/980 - -
添加了对从命名 cgroup 读取限制的支持. 以前, 我们仅从全局范围内阅读.
Closing
在容器, 虚拟机大家可以去尝试 Preview2. 希望大家对. NET5 提出并反馈意见. 接下来几个月里面, 将会有更多的版本发布. 最终将在 11 月发布正式版本.
作为测试案例, 目前. NET 5.0 在 Azure 负载均衡上运行了. NET 网站 https://dotnet.microsoft.com/ 的 50% 的流量.
自从发布预览版 1 天以来一直在上面这么做了, 也许大家还记得. NET Core3.0 和 3.1 也这样做过测试案例.
通过将流量分流为 5/5, 可以确保在不断地性能数据情况下 5.0 将持续的改进变得更好. 这种测试是公开的, 也是一种很好的测试方法, 目前用. NET5 在核心网站的生产环境这将是对. NET5 最大的信任, 当然不建议大家这样是哟经, 建议等等. 目前版本号在网站 https://dotnet.microsoft.com/ 的页脚中可以看到.
来源: https://www.cnblogs.com/yyfh/p/12631578.html