3 ms·
There's a per-packet bounds check here [1] which probably can't be eliminated by the compiler because it cycles over the array. I imagine that's noticeable. [1
by GrayShade 7y ago
There's a per-packet bounds check here [1] which probably can't be eliminated by the compiler because it cycles over the array. I imagine that's noticeable.
[1]: https://github.com/ixy-languages/ixy.rs/blob/master/src/ixgbe.rs#L175 https://github.com/ixy-languages/ixy.rs/blob/master/src/ixgb...
- ChrisSD 7y agoSo the bounds check is: queue.bufs_in_use[rx_index] If so the bounds check could possibly be safely eliminated by the programmer because I think `wrap_ring` ensures that rx_index will always be in bounds?
- GrayShade 7y agoYes. It wouldn't be too unidiomatic to use get_unchecked in those two places, perhaps with a debug_assert! in place. It would be really nice if this wasn't needed, but it's a valid use of unsafe code.