n字节对齐 代码
Is large-but-correctly-aligned-and-optimized code faster than less-bytes-per-instruction/opcode-packed code?
大但正确对齐和优化的代码是否比每个指令/操作码打包的字节少的代码快 ?
Alex Ionescu mentioned in ros-dev mailing list:
ros-dev邮件列表中提到的Alex Ionescu:
kernel code to be “smaller” instead of “faster” though — on modern processors for cases like interrupts and such, large-but-correctly-aligned-and-optimized code is faster than less-bytes-per-instruction/opcode-packed code. 内核代码“更小”而不是“更快” —在现代处理器上,如中断之类的情况,大但正确对齐和优化的代码比不那么快—每指令字节数/操作码打包代码。
ie:
即:mov eax, [foo] add eax, 1 mov [foo], eax
mov eax, [foo] add eax, 1 mov [foo], eax
is faster than
比
inc [foo]
Answered by anonymous.
匿名回答。
n字节对齐 代码