(&self, node_id: u32)
| 56 | /// reaches them on the next iteration. |
| 57 | #[inline] |
| 58 | pub fn prefetch_node(&self, node_id: u32) { |
| 59 | let idx = node_id as usize; |
| 60 | if idx + 1 < self.out_offsets.len() { |
| 61 | // SAFETY: We're just hinting the CPU to load this address. |
| 62 | // The offset is within bounds (checked above). This is a |
| 63 | // performance hint, not a correctness requirement. |
| 64 | #[cfg(target_arch = "x86_64")] |
| 65 | unsafe { |
| 66 | let ptr = self.out_offsets.as_ptr().add(idx) as *const u8; |
| 67 | std::arch::x86_64::_mm_prefetch(ptr as *const i8, std::arch::x86_64::_MM_HINT_T0); |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /// Prefetch a batch of nodes (called during BFS frontier expansion). |
| 73 | pub fn prefetch_batch(&self, node_ids: &[u32]) { |
no test coverage detected