mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-26 07:52:05 +03:00
Speed up cell drawing in Lyon, where logs about leaking out of the boundary happens frequently
This commit is contained in:
parent
a421eaf900
commit
0f0384949d
@ -87,6 +87,7 @@ impl RenderCellsBuilder {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Initially fill out the grid based on the roads in each cell
|
// Initially fill out the grid based on the roads in each cell
|
||||||
|
let mut warn_leak = true;
|
||||||
for (cell_idx, cell) in neighborhood.cells.iter().enumerate() {
|
for (cell_idx, cell) in neighborhood.cells.iter().enumerate() {
|
||||||
for (r, interval) in &cell.roads {
|
for (r, interval) in &cell.roads {
|
||||||
let road = map.get_r(*r);
|
let road = map.get_r(*r);
|
||||||
@ -111,10 +112,15 @@ impl RenderCellsBuilder {
|
|||||||
//
|
//
|
||||||
// Example is https://www.openstreetmap.org/way/87298633
|
// Example is https://www.openstreetmap.org/way/87298633
|
||||||
if grid_idx >= grid.data.len() {
|
if grid_idx >= grid.data.len() {
|
||||||
|
if warn_leak {
|
||||||
warn!(
|
warn!(
|
||||||
"{} leaks outside its neighborhood's boundary polygon, near {}",
|
"{} leaks outside its neighborhood's boundary polygon, near {}",
|
||||||
road.id, pt
|
road.id, pt
|
||||||
);
|
);
|
||||||
|
// In some neighborhoods, there are so many warnings that logging
|
||||||
|
// causes noticeable slowdown!
|
||||||
|
warn_leak = false;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user