various performance work (wip)
This commit is contained in:
parent
e77fd6e69f
commit
71e263c527
1 changed files with 4071 additions and 326 deletions
|
|
@ -378,6 +378,24 @@ def run_example_06() -> ScenarioOutcome:
|
|||
|
||||
|
||||
def snapshot_example_07() -> ScenarioSnapshot:
|
||||
return _snapshot_example_07_variant(
|
||||
"example_07_large_scale_routing",
|
||||
warm_start_enabled=True,
|
||||
)
|
||||
|
||||
|
||||
def snapshot_example_07_no_warm_start() -> ScenarioSnapshot:
|
||||
return _snapshot_example_07_variant(
|
||||
"example_07_large_scale_routing_no_warm_start",
|
||||
warm_start_enabled=False,
|
||||
)
|
||||
|
||||
|
||||
def _snapshot_example_07_variant(
|
||||
name: str,
|
||||
*,
|
||||
warm_start_enabled: bool,
|
||||
) -> ScenarioSnapshot:
|
||||
bounds = (0, 0, 1000, 1000)
|
||||
obstacles = [
|
||||
box(450, 0, 550, 400),
|
||||
|
|
@ -420,6 +438,7 @@ def snapshot_example_07() -> ScenarioSnapshot:
|
|||
"capture_expanded": True,
|
||||
"shuffle_nets": True,
|
||||
"seed": 42,
|
||||
"warm_start_enabled": warm_start_enabled,
|
||||
},
|
||||
)
|
||||
|
||||
|
|
@ -432,7 +451,7 @@ def snapshot_example_07() -> ScenarioSnapshot:
|
|||
t0 = perf_counter()
|
||||
results = pathfinder.route_all(iteration_callback=iteration_callback)
|
||||
t1 = perf_counter()
|
||||
return _make_snapshot("example_07_large_scale_routing", results, t1 - t0, pathfinder.metrics.snapshot())
|
||||
return _make_snapshot(name, results, t1 - t0, pathfinder.metrics.snapshot())
|
||||
|
||||
|
||||
def run_example_07() -> ScenarioOutcome:
|
||||
|
|
@ -534,6 +553,10 @@ SCENARIO_SNAPSHOTS: tuple[tuple[str, ScenarioSnapshotRun], ...] = (
|
|||
("example_09_unroutable_best_effort", snapshot_example_09),
|
||||
)
|
||||
|
||||
PERFORMANCE_SCENARIO_SNAPSHOTS: tuple[tuple[str, ScenarioSnapshotRun], ...] = (
|
||||
("example_07_large_scale_routing_no_warm_start", snapshot_example_07_no_warm_start),
|
||||
)
|
||||
|
||||
|
||||
def capture_all_scenario_snapshots() -> tuple[ScenarioSnapshot, ...]:
|
||||
return tuple(run() for _, run in SCENARIO_SNAPSHOTS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue