运行时之书-在文档中找不到的.NET运行时内部

The Microsoft Docs at https://docs.microsoft.com are really fantastic lately. All the .NET Docs are on GitHub https://github.com/dotnet/docs/ and you can contribute to them. However, in the world of software engineering (here some a bad, mixed metaphor) there's instructions on how to use a faucet and there's instructions on how to build and design plumbing from scratch.

https://docs.microsoft.com上的Microsoft文档最近真的很棒。 所有.NET文档都在GitHub https://github.com/dotnet/docs/上,您可以为它们做贡献。 但是,在软件工程界(这里是一个不好的,混合的比喻),有关于如何使用水龙头的说明,也有关于如何从头开始构建和设计管道的说明。

There's additional DEEP docs that don't really belong on the docs site. It's the Book of the Runtime and for now it's on GitHub. Here's the BotR FAQ.

还有其他DEEP文档,它们实际上并不属于文档站点。 这是运行时书,现在在GitHub上。 这是BotR常见问题解答

If you're interested in the internals of a system like the .NET Runtime, these docs are a gold mine for you.

如果您对诸如.NET Runtime之类的系统内部感兴趣,那么这些文档对您来说就是金矿。

The Book of the Runtime is a set of documents that describe components in the CLR and BCL. They are intended to focus more on architecture and invariants and not an annotated description of the codebase.

运行时的书是一组描述了CLR和BCL组件文件。 它们旨在更多地关注体系结构和不变式,而不是对代码库的带注释的描述。

It was originally created within Microsoft in ~ 2007, including this document. Developers were responsible to document their feature areas. This helped new devs joining the team and also helped share the product architecture across the team.

它最初由Microsoft在2007年左右创建,包括本文档。 开发人员负责记录其功能区域。 这有助于新开发人员加入团队,也有助于在团队中共享产品架构。

We realized that the BotR is even more valuable now, with CoreCLR being open source on GitHub. We are publishing BotR chapters to help a new set of CLR developers.

我们意识到,BotR现在更具价值,而CoreCLR在GitHub上是开源的。 我们将发布BotR章节,以帮助一组新的CLR开发人员。

This book likely isn't for you if you're an app developer. Who is it for?

如果您是应用程序开发人员,则此书可能不适合您。 是给谁用的?

  • Developers who are working on bugs that impinge on an area and need a high level overview of the component.

    正在开发可能会影响某个区域并需要对该组件进行高级概述的错误的开发人员。
  • Developers working on new features with dependencies on a component need to know enough about it to ensure the new feature will interact correctly with existing components.

    开发人员依赖于组件的新功能的开发人员需要对此有足够的了解,以确保新功能将与现有组件正确交互。
  • New developers need this chapter to maintain a given component.

    新开发人员需要本章来维护给定的组件。

These aren't design documents, these are docs that were written after features are implemented in order to explain how they work in practice.

这些不是设计文档,而是在实现功能后编写的文档,目的是解释它们在实践中的工作方式。

Recently Carol Eidt wrote an amazing walkthrough to .NET Core's JIT engine. Perhaps start at the JIT Overview and move to the deeper walkthrough. Both are HUGELY detailed and a fascinating read if you're interested in how .NET makes Dynamic Code Execution near-native speed with the RyuJIT - the next-gen Just in Time compiler.

最近, Carol Eidt对.NET Core的JIT引擎进行了精彩的演练。 也许从《 JIT概述》开始,然后进行更深入的演练。 如果您对.NET如何使用RyuJIT(下一代准时编译器)使动态代码执行接近自然速度感兴趣,两者都非常详尽,并且引人入胜。

Here's a few highlights I enjoyed but you should read the whole thing yourself. It covers the high level phases and then digs deeper into the responsibilities of each. You also get a sense of why the RyuJIT is NOT the same JITter from 15+ years ago - both the problem space and processors have changed.

这是我喜欢的一些重点内容,但是您应该自己阅读整个内容。 它涵盖了高层阶段,然后深入探讨了每个阶段的职责。 您还将了解为什么RyuJIT与15年前的JITter不同-问题空间和处理器都发生了变化。

This is the 10,000 foot view of RyuJIT. It takes in MSIL (aka CIL) in the form of byte codes, and the Importer phase transforms these to the intermediate representation used in the JIT. The IR operations are called “GenTrees”, as in “trees for code generation”. This format is preserved across the bulk of the JIT, with some changes in form and invariants along the way. Eventually, the code generator produces a low-level intermediate called InstrDescs, which simply capture the instruction encodings while the final mappings are done to produce the actual native code and associated tables.

这是RyuJIT的10,000英尺视图。 它以字节码的形式接收MSIL(aka CIL),并且Importer阶段将其转换为JIT中使用的中间表示。 IR操作称为“ GenTrees”,如“代码生成树”中一样。 这种格式在整个JIT中都会保留下来,并且在形式和不变性方面会有所变化。 最终,代码生成器生成了一个称为InstrDescs的低级中间件,该中间件仅捕获指令编码,同时完成最终映射以生成实际的本机代码和关联的表。

ryujit-phase-diagram

This is just one single comprehensive doc in a collection of documents. As for the rest of the Book of the Runtime, here's the ToC as of today, but there may be new docs in the repository as it's a living book.

这只是一系列文档中的一个综合文档。 至于《运行时手册》的其余部分,这是今天的ToC,但由于它是一本活着的书,因此存储库中可能会有新文档

Check it out!

看看这个!

Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test and debug ASP.NET, .NET Framework, .NET Core, Xamarin or Unity applications. Learn more and download a 30-day trial!

赞助商:查看JetBrains Rider :一个新的跨平台.NET IDE 。 编辑,重构,测试和调试ASP.NET,.NET Framework,.NET Core,Xamarin或Unity应用程序。 了解更多信息并下载30天试用版

翻译自: https://www.hanselman.com/blog/the-book-of-the-runtime-the-internals-of-the-net-runtime-that-you-wont-find-in-the-documentation

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值