Skip to content

Optimize road-based pickup ETA matching - #34

Merged
aom12345 merged 1 commit into
wncc:mainfrom
agrawalmilin9:feat/road-pickup-eta
Oct 27, 2026
Merged

aom12345 merged 1 commit into
wncc:mainfrom
agrawalmilin9:feat/road-pickup-eta

Conversation

@agrawalmilin9

Copy link
Copy Markdown

Summary

Optimize road-based pickup ETA calculations in driver matching.

Reuse compiled routing rules during reverse-search calculations.

Cache repeated base-rule and turn-cost evaluations.

Add Mumbai road-network benchmarks for batch routing and driver selection.

Testing

Full test suite: 118 passed, 16 subtests passed.

Warm batch routing median: 180.7 ms for 10 routes.

Ten individual routes: 477.0 ms.

Warm nearest-driver selection median: 151.9 ms for 10 drivers from 50 candidates.

Benchmark timings are from a local run on the Mumbai road graph and may vary by machine. Router loading and graph construction are excluded from the routing timing target.

Testing

  • Full test suite: 118 passed, 16 subtests passed.
  • Warm batch routing median: 180.7 ms for 10 routes.
  • Ten individual routes: 477.0 ms.
  • Warm nearest-driver selection median: 151.9 ms for 10 drivers from 50 candidates.

Benchmark timings are from a local run on the Mumbai road graph and may vary by machine. Router loading and graph construction are excluded from the routing timing target.

Closes #24

@aom12345

Copy link
Copy Markdown
Collaborator

Merged; the tests and the batch-versus-single comparison look good. Main concern: run_cycle is synchronous in the dispatch cycle and about 180 ms per rider, which blocks the event loop and holds the row locks from #30. Please run it in a thread or cap the riders per cycle. Also: CompiledModel is rebuilt on every call, TurnModel._cache is unbounded and ignores the when argument #36 adds, there's no backend test for the RouteService wiring, and one benchmark file has a BOM. Issue stays open for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Road-based pickup times in matching (fast enough for every cycle)

3 participants