Comment #7 on issue 1239 by [email protected]: ES5 getter/setter
performance
http://code.google.com/p/v8/issues/detail?id=1239
Actually dumbgetterbenchmark does not allow to V8 to reveal its full
potential because all test cases are done sequentially as loop on the
top-level so everything goes through ICs.
Attached benchmarks demonstrates true power of Crankshaft. If we look at
the loop then getter invocation is completely inlined and hoisted out of
the loop:
;;; @50: load-named-field.
0x4d530e7c 188 8b7f0b mov edi,[edi+0xb]
;;; @51: gap.
0x4d530e7f 191 89fa mov edx,edi
;;; @52: tagged-to-i.
0x4d530e81 193 f6c201 test_b dl,0x1
0x4d530e84 196 0f85d1000000 jnz 411 (0x4d530f5b)
0x4d530e8a 202 d1fa sar edx,1
;;; @53: gap.
;;; @54: gap.
;;; @55: goto.
;;; @56: label.
;;; B5 - LOOP entry
;;; @57: gap.
;;; @58: gap.
;;; @59: cmp-id-and-branch.
0x4d530e8c 204 3bc6 cmp eax,esi
0x4d530e8e 206 0f8d20000000 jnl 244 (0x4d530eb4)
;;; @64: label.
;;; B7
;;; @65: gap.
;;; @66: stack-check.
0x4d530e94 212 3b250c170209 cmp esp,[0x902170c]
0x4d530e9a 218 0f82ea000000 jc 458 (0x4d530f8a)
;;; @67: gap.
;;; @68: gap.
;;; @69: goto.
;;; @70: label.
;;; B8
;;; @71: gap.
0x4d530ea0 224 89cb mov ebx,ecx
;;; @72: add-i.
0x4d530ea2 226 03da add ebx,edx
0x4d530ea4 228 0f808891ed0b jo 0x5940a032 ;;
deoptimization bailout 5
;;; @73: gap.
;;; @74: add-i.
0x4d530eaa 234 83c001 add eax,0x1
;;; @75: gap.
;;; @76: gap.
0x4d530ead 237 89d9 mov ecx,ebx
0x4d530eaf 239 8b5dd8 mov ebx,[ebp+0xd8]
;;; @77: goto.
0x4d530eb2 242 ebd8 jmp 204 (0x4d530e8c)
~/src/v8 ∮ out/ia32.release/d8 notsodumbgetterbenchmark.js
*** Direct access: 595 ***
*** __defineGetter__: 595 ***
*** Old-fashioned getter: 598 ***
*** ES5 getter: 591 ***
*** Prototype getter: 598 ***
Fantastic news!
Attachments:
notsodumbgetterbenchmark.js 1.3 KB
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev