Message217837
> I would think that in real-world code, this branch will almost never be
taken. The common case will pay a price (albiet a small one) for almost
zero benefit.
I think that x << 0 is common even if it's not written like that (it's more
for i in range(8): ... x << i).
The benefit is to reduce the memory footprint.
Can you sow the overhead of the branch in a microbenchmark? The test is
only done once, it's out of a loop.
*If* it's possible to notice an overhead, we can maybe use GCC macro
unlikely(). |
|
Date |
User |
Action |
Args |
2014-05-03 22:41:29 | vstinner | set | recipients:
+ vstinner, rhettinger, mark.dickinson, serhiy.storchaka |
2014-05-03 22:41:29 | vstinner | link | issue21422 messages |
2014-05-03 22:41:29 | vstinner | create | |
|