assembly - Significant time spent in function call -
I have a function that is called multiple times during my code, it seems ~ 45% of the total time code Run (reported by Intel Vetuune), but, as the function is computational expensive, I am not very surprised at this. I am surprised that, however, the amount of time VTune tells me that I'm spending on overhead to call the function (i.e. the time reported next to the function announcement). The function declaration is as follows:
Subroutine tempFunc (beg, matProp, timestep, matid) The parameter I am passing is just a , 100 real * 8 variable, other real * 8 , and 32 integer s like Fortran reference Everything passes away, and there are only 4 variables, I believe that this call should be very high. However, ~ 15% of the time spent in the ceremony has been called overhead. Looking at the assembly code, it all time is spent on the following instructions: mov dword ptr [rsp + rax * 1], 0xccccccc sub rax, 0x4 I know enough assembly to know that rsp is a stack pointer and it is a rax 64-bit register. It appears that the first line is an indicator Is being taken to the rax register, and the second line is just to subtract something from that register. Am I wrong in my understanding? If so, then what are these two instructions actually doing? If not, why are these two instructions taking so long? They appear absolutely innocently.
Not at all.
The first instruction that is being loaded is indicated by the combination of hex value in memory to rsp and rax . [...] is a memory access operation. The second directive decreases by rax by this action makes me believe it can be Well done in a loop because otherwise, it decreases decreasing decrease. If it is to spend 15% on those instructions, which is on the fore side that it is within a loop.
If it is , then a part of the loop stack is filling with 0xcccc .cc values and it can be well expensive. We have to look at the whole function to ensure this, preferably both the source and codlar can get you some locals well within the function which are initial.
Comments
Post a Comment