3 ms·
I'd be interested to see benchmark numbers for LuaJIT, which makes it extremely easy to compile with either replicated dispatch (each bytecode instruction foote
by haberman 11y ago
I'd be interested to see benchmark numbers for LuaJIT, which makes it extremely easy to compile with either replicated dispatch (each bytecode instruction footer has a separate dispatch "jmp" instruction) or common dispatch (each bytecode instruction jumps to a common dispatch "jmp" instruction): http://repo.or.cz/w/luajit-2.0.git/blob/a5b1c4d98eeb97a950774ae032f51f820dfbfc4c:/src/vm_x86.dasc#l299 http://repo.or.cz/w/luajit-2.0.git/blob/a5b1c4d98eeb97a95077...
// Instruction footer.
.if 1
// Replicated dispatch. Less unpredictable branches, but higher I-Cache use.
.define ins_next, ins_NEXT
.define ins_next_, ins_NEXT
.else
// Common dispatch. Lower I-Cache use, only one (very) unpredictable branch.
// Affects only certain kinds of benchmarks (and only with -j off).
// Around 10%-30% slower on Core2, a lot more slower on P4.
.macro ins_next
jmp ->ins_next
.endmacro
.macro ins_next_
->ins_next:
ins_NEXT
.endmacro
.endif