a-b-street/abstreet

Optimize scheduler

Aperta

#54 aperta il 30 apr 2020

 (12 commenti) (0 reazioni) (0 assegnatari)Rust (256 fork)batch import
good first issue

Metriche repository

Star
 (6779 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor