e******d 发帖数: 14 | 1 Code optimization 有这么一条 Avoid array indexing, Use pointers. 为什么呢?不需要再算地址了?
还有 Use int (natural word-size of the processor) to store flags rather than char or short。就因为alignment? | g*****g 发帖数: 34805 | 2 I would say leave these stuff to smart compiler,
clean and readable code is more important in 99.9% of case.
?不需要再算地址了?
than char or short。就因为alignment?
【在 e******d 的大作中提到】 : Code optimization 有这么一条 Avoid array indexing, Use pointers. 为什么呢?不需要再算地址了? : 还有 Use int (natural word-size of the processor) to store flags rather than char or short。就因为alignment?
| t****t 发帖数: 6806 | 3 context: <>
【在 g*****g 的大作中提到】 : I would say leave these stuff to smart compiler, : clean and readable code is more important in 99.9% of case. : : ?不需要再算地址了? : than char or short。就因为alignment?
| g*****g 发帖数: 34805 | 4 That's exactly my point, this level of optimization should be done
by compiler. In code optimization context, it's about the 80-20 rule,
find out the bottleneck, use the better algorithm if there's any,
cut the redudant code, move out what doesn't have to be in loop.
99.9% cases these are more than enough. And in case they are not,
those little dirty tricks are not good enough to help either.
【在 t****t 的大作中提到】 : context: <>
|
|