|
|
|
|
|
by Gankra
1293 days ago
|
|
No the claim is always that Rust "must" be slower than C/C++ because it has pervasive bounds checking for array indexing. Then people insist on wanting to replace every x[i] in prod with x.get_unchecked(i) only to learn that, not only was that indexing not slowing the code down (the branch is perfectly predictable in a correct program!), but actually any difference is so in the noise that the random perturbation is worse (or that the asserts were actually adding extra facts for more profitable optimizations in llvm). There is definitely specific hot loops with weird access patterns where it can be high impact but those are the exception, not the rule, as the Android team demonstrated. |
|