![]() # Objective - Since #10811,Bevy uses `assert `in the hot path of iteration. The `for_each `method has an assert in the outer loop to help the compiler remove unnecessary branching in the internal loop. - However , ` for` style iterations do not receive the same treatment. it still have a branch check in the internal loop, which could potentially hurt performance. ## Solution - use `TableRow::from_u32 ` instead of ` TableRow::from_usize` to avoid unnecessary branch. Before  After ----------------------------------------------------------------------------  |
||
---|---|---|
.. | ||
blob_vec.rs | ||
mod.rs | ||
resource.rs | ||
sparse_set.rs | ||
table.rs |