cuốn sách gpt4 ai đã làm

c# - 在C#程序中,ThePreStub是什么?

In lại Tác giả: Hồ Xil 更新时间:2023-11-01 03:00:22 27 4
mua khóa gpt4 Nike

在分析 C# 应用程序时,我发现名为“ThePreStub”的系统 (?) 方法中有相当多的 CPU 使用率。这是什么?

câu trả lời hay nhất

参见:CLR Inside out - The Performance Benefits of NGen.

Throughput of NGen-compiled code is lower than that of JIT-compiled code primarily for one reason: cross-assembly references. In JIT-compiled code, cross-assembly references can be implemented as direct calls or jumps since the exact addresses of these references are known at run time. For statically compiled code, however, cross-assembly references need to go through a jump slot that gets populated with the correct address at run time by executing a method pre-stub. The method pre-stub ensures, among other things, that the native images for assemblies referenced by that method are loaded into memory before the method is executed. The pre-stub only needs to be executed the first time the method is called; it is short-circuited out for subsequent calls. However, every time the method is called, cross-assembly references do need to go through a level of indirection. This is principally what accounted for the 5-10 percent drop in throughput for NGen-compiled code when compared to JIT-compiled code.

关于c# - 在C#程序中,ThePreStub是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19498805/

27 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress