Paste: function call cost microbenchmark (x86/core2)
Author: | prunedtree |
Mode: | assembly-x86 |
Date: | Fri, 23 Jan 2009 07:32:27 |
Plain Text |
10k iterations, i += f(i) where f(x) = x
inline 20076
direct 70080
indirect 80103
virtual 80197
(in cycles, core2, 32 bit)
00023 33 c0 xor eax, eax
$L1176:
00025 03 f0 add esi, eax
00027 40 inc eax
00028 3d 10 27 00 00 cmp eax, 10000
0002d 7c f6 jl SHORT $L1176
00053 33 f6 xor esi, esi
$L1183:
00055 56 push esi
00056 e8 00 00 00 00 call ?f_direct@@YAHH@Z
0005b 83 c4 04 add esp, 4
0005e 03 f8 add edi, eax
00060 46 inc esi
00061 81 fe 10 27 00
00 cmp esi, 10000
00067 7c ec jl SHORT $L1183
0008d 33 f6 xor esi, esi
$L1189:
0008f 56 push esi
00090 ff 15 00 00 00
00 call DWORD PTR ?f_indirect@@3P6AHH@ZA
00096 83 c4 04 add esp, 4
00099 03 f8 add edi, eax
0009b 46 inc esi
0009c 81 fe 10 27 00
00 cmp esi, 10000
000a2 7c eb jl SHORT $L1189
000c8 33 f6 xor esi, esi
$L1195:
000ca 8b 0d 00 00 00
00 mov ecx, DWORD PTR ?obj@@3PAVObject@@A
000d0 56 push esi
000d1 8b 01 mov eax, DWORD PTR [ecx]
000d3 ff 50 04 call DWORD PTR [eax+4]
000d6 03 f8 add edi, eax
000d8 46 inc esi
000d9 81 fe 10 27 00
00 cmp esi, 10000
000df 7c e9 jl SHORT $L1195
Author: | prunedtree |
Mode: | assembly-x86 |
Date: | Fri, 23 Jan 2009 07:36:24 |
Plain Text |
00000 8b 44 24 04 mov eax, DWORD PTR _i$[esp-4]
00004 c3 ret 0
New Annotation