Skip to content

Commit

Permalink
Log the number of bytes in the arena at the end of route finding
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Aug 5, 2023
1 parent 0c01c73 commit c937f81
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/diff/dijkstra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ fn shortest_vertex_path<'s, 'b>(
}

if seen.len() > graph_limit {
info!(
"Reached graph limit, arena consumed {} bytes",
vertex_arena.allocated_bytes(),
);
return Err(ExceededGraphLimit {});
}
}
Expand All @@ -65,9 +69,10 @@ fn shortest_vertex_path<'s, 'b>(
};

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(),
std::mem::size_of::<Vertex>(),
vertex_arena.allocated_bytes(),
heap.len(),
);

Expand Down

0 comments on commit c937f81

Please sign in to comment.