Log the number of bytes in the arena at the end of route finding

try_similar_lib
Wilfred Hughes 2023-08-04 17:02:35 +07:00
parent 0c01c73398
commit c937f819a1
1 changed files with 6 additions and 1 deletions

@ -57,6 +57,10 @@ fn shortest_vertex_path<'s, 'b>(
} }
if seen.len() > graph_limit { if seen.len() > graph_limit {
info!(
"Reached graph limit, arena consumed {} bytes",
vertex_arena.allocated_bytes(),
);
return Err(ExceededGraphLimit {}); return Err(ExceededGraphLimit {});
} }
} }
@ -65,9 +69,10 @@ fn shortest_vertex_path<'s, 'b>(
}; };
info!( info!(
"Saw {} vertices (a Vertex is {} bytes), with {} left on heap.", "Saw {} vertices (a Vertex is {} bytes), arena consumed {} bytes, with {} vertices left on heap.",
seen.len(), seen.len(),
std::mem::size_of::<Vertex>(), std::mem::size_of::<Vertex>(),
vertex_arena.allocated_bytes(),
heap.len(), heap.len(),
); );