a-b-street/abstreet

Optimize scheduler

Open

#54 opened on Apr 30, 2020

View on GitHub
 (12 comments) (0 reactions) (0 assignees)Rust (256 forks)batch import
good first issue

Repository metrics

Stars
 (6,779 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Profiling reveals https://github.com/dabreegster/abstreet/blob/master/sim/src/scheduler.rs as a hot spot, which makes sense. Anybody have ideas to speed it up? It's a priority queue with updateable priorities. There are lots of alternatives to std::collections::BinaryHeap, but I think I had trouble finding one that was deterministic (given the same inputs, simulations must run exactly the same).

I squeezed running a huge scenario from 71s to 63s using 7a0b9cd09a96e155a26f3304029d7c3ae753a9dc. I bet there's more possible.

Contributor guide