Reasons clr! JIT_New on the PerfView stack

I use PerfView to customize the application, and the second most expensive item is currently marked as:

OTHER <<clr! JIT_New →

on more than 10% of the CPU. This continues even for subsequent runs of the test case.

Can anyone determine which code actions or methods can cause the dynamic generation of new code that requires JIT-ting?

+4
source share
1 answer

JIT_New () is a helper function inside the CLR that runs whenever you create a new object in code with a new statement. It simply allocates memory from the collected garbage heap and calls the class constructor. Or, in other words, he implements the Opcodes.Newobj IL team. His name is a bit confusing; it has nothing to do with jittering your code. Just a helper function that jitter knows about, it compiles a call to that helper function directly into the generated machine code. JIT_Newarr1 () will be the other you come across, it allocates an array.

I don't know PerfView, note that the runtime for JIT_New () may include the time it takes for garbage collectors to execute. What happens when the gen # 0 heap is full when JIT_New () is run. Which explains the large percentage, JIT_New () is otherwise very fast. There is nothing you can do about it; this is the correction of the overhead in any managed program.

+7
source

Source: https://habr.com/ru/post/1484315/


All Articles